การ Filter ข้อมูล 2 Filed ทำอย่างไรครับผม
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 246   2
URL.หัวข้อ / URL
การ Filter ข้อมูล 2 Filed ทำอย่างไรครับผม

Me.Filter = "b_month =" & VarMonth 'And "b_years= " & VarYear
Me.FilterOn = True

If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "ไม่พบข้อมูลในการค้นหา", vbOKOnly + vbInformation, "คำชี้แจ้ง"
cmdReportByUnit.Enabled = False
End If
ผมใช้คำสั่งนี้ แต่อีก Filed หนึ่งไม่ออกผมเลย Comment เอาไว้

2 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R04574
ลองเปลี่ยนเป็น

Me.Filter = "b_month =" & VarMonth & " And b_years= " & VarYear
Me.FilterOn = True

ซึ่งจะใช้ได้ก็ต่อเมื่อฟีลด์ทั้งสองเป็น number หมด

ถ้าเป็น text ให้เปลี่ยนเป็น

Me.Filter = "b_month ='" & VarMonth & "' And b_years= '" & VarYear & "'"
Me.FilterOn = True


2 @R04576
ขอบคุณมาก ทันใจจริง ๆ อาจารย์ครับ
ตอนนี้ผมกำลังศึกษา Mysql +php+linux+Appser อยู่นะ
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0587s