em có 1 bản là ttcauthu gồm các trường masoao, tencauthu, ngaysinh...
và Form1 là danh sách cầu thủ. Em làm 1 việc như sau ( theo hướng dẫn của anh phatnqt2002 ): tạo 1 nút tìm trên Form1 ( danh sách cầu thủ ), khi ta nhấn vào nút tìm để xuất hiện 1 form khác để ta nhập vào tên cầu thủ cần tìm kiếm và code của nó đây. Không hiểu sao nữa
Mã:
Option Compare Database
Dim st As String, rs As DAO.Recordset
Private Sub form_load()
Set rs = Forms("ttcauthu").RecordsetClone
End Sub
Private Sub thuchien_click()
st = "tencauthu Like'*" & tencauthu & "*'"
On Error GoTo loi_thuchien
rs.FindFirst st
If rs.NoMatch Then
msgbox "Neu khong tim thay"
Else
Forms("ttcauthu").Bookmark = rs.Bookmark
End If
thoat_thuchien:
Exit Sub
loi_thuchien:
msgbox "Loi. Khong tim thay cau thu"
Resume thoat_thuchien
End Sub
Private Sub timtiep_ckick()
On Error GoTo loi_timtiep
rs.FindNext st
If rs.NoMatch Then
msgbox "Khong con tim thay nua"
Else
Forms("masoao").Bookmark = rs.Bookmark
End If
thoat_timtiep
Exit Sub
loi_tiemtiep
msgbox "Loi.Khong con tim thay nua"
Resume thoat_timtiep
End Sub
Private Sub thoi_click()
DoCmd.Close acForm, Me.Name
End Sub
Mong các bạn giúp đỡ. Thanks nhiều
View more random threads:
For pet owners who prioritize style and comfort, a large wicker dog bed on legs offers a blend of functionality, aesthetic appeal, and durability. Designed to provide your furry friend with a cozy...
Elevate Your Pet's Comfort: Large Wicker Dog Bed on Legs