แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - thaworn Panchan

หน้า: [1]
1
Private Sub CmdFind_Click()
Dim strFindName As String

If IsNull(Me.TxtFind) Or (Me.TxtFind) = “” Then
MsgBox “ใส่ข้อมูลไม่ครบ โปรดตรวจสอบ”
Me.TxtFind.SetFocus
Else
strFindName = “SELECT * FROM [บุคคลากร] WHERE [ชื่อ-นามสกุล] LIKE ‘” & TxtFind & “*’;”
Me.RecordSource = strFindName
Me.Requery
Me.TxtFind.SetFocus
Me.TxtFind = Null
End If

สวัสดีครับ…
คือจากตัวอย่าง Code ที่ผมแนบมา ผมอยากให้ทำงานเพิ่ม คือ
1.เมื่อค้นแล้ว ไม่พบเรคคอร์ด จะต้อง msgbox “ไม่พบข้อมูล”
2.เมื่อค้นแล้ว พบมากกว่า 1 เรคคอร์ด ให้แสดง msgbox “พบ..เรคคอร์ด” (เพราะโปรแกรมต้องแสดงรูปด้วย)
ขอขอบคุณน่ะครับ

หน้า: [1]