A/C giup lenh tim kiem
nvthanghcm > 07-10-14, 05:43 PM
A/c giup gium cau lenh sai nhu the nao minh ko chay duoc.
minh muon tim kiem truc tiep tren form, khi hoso trung thi load hoso do ra form.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim rs As Recordset
Dim thongbao As Boolean
Set rs = CurrentDb.OpenRecordset("bang_th", dbOpenTable)' table co ten la bang_th
rs.MoveFirst
thongbao = False
Do While Not rs.EOF
If rs.Fields("id") = idhoso.Value Then ' trong table co file id, tren form co textbox: idhoso
thongbao = True
Exit Do
End If
rs.MoveNext
Loop
If thongbao = False Then
MsgBox "ko tom thay "
Else
Me.Bookmark = rs.Bookmark