ค้นหาจากทุกฟิลด์


0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

27 ต.ค. 64 , 16:14:00
อ่าน 607 ครั้ง

001Jetnipit

ค้นหาจากทุกฟิลด์
« เมื่อ: 27 ต.ค. 64 , 16:14:00 »
โค๊ด: [Select]
Private Sub CmdSearch_Enter()
Dim sql As String
Dim FindRecordCount  As Long
Dim rstRecords As Recordset
sql = "SELECT * FROM Table1 Where [Name] like '*" & Nz(Me.Text1, "*") & "*' AND [F1]  [F2] [F3] like '" & Nz(Me.Combo1, "*") & "'"
Set rstRecords = CurrentDb.OpenRecordset(sql)
Forms!Form1!Table1subform.Form.RecordSource = sql
Forms!Form1!Table1subform.Form.Form.Requery

    If rstRecords.EOF Then
            FindRecordCount = 0
        Else
            rstRecords.MoveLast
            FindRecordCount = rstRecords.RecordCount
        End If
   If FindRecordCount = 0 Then
   MsgBox "Not Found!", vbCritical, "Status"
   End If


ตรง
โค๊ด: [Select]
AND [F1]  [F2] [F3] like '" & Nz(Me.Combo1, "*") ไม่แน่ใจว่ามันต้องเชื่อมยังไงหรือต้องเขียน VBA ทางไหน รบกวนขอความกรุณาครับ



 


บอร์ดเรียนรู้ Access สำหรับคนไทย



There are no comments for this topic. Do you want to be the first?
 

Sitemap 1 2 3 4 5