ใน Form นั้น ข้อมูล Bound กับตัว Control ที่ดึงมาจาก Query หรือเปล่าครับ
ถ้าใช้ ผมว่าใช้คำสั่ง ApplyFilter ในการค้นหาก็ได้ครับ
ตัวอย่างคำสั่ง ใช้ใน Event on Click ที่ตัว CommandBotton
Private Sub Search_Click()
if Not IsNull (
ตัว ControlTextBox ที่ใช้ค้นหา) then
DoCmd.ApplyFilter , " CIF like '*' & [Forms]![
ชื่อฟอร์ม]![
ชื่อ ControlTextBox ที่ใช้ค้นหา] &'*'"
Else
MsgBox "กรุณาระบุ รหัส CIF ก่อน", vbOKOnly, "แจ้ง"
ชื่อ ControlTextBox ที่ใช้ค้นหา.SetFocus
end if
End Sub
หรือส่งไฟล์มาดูผมแก้ให้ทาง
[email protected] ก็ได้คับ