longkd_bvct@yahoo.com.vn > 23-06-23, 03:45 PM
Sub TimGiaTriTrungNhau()
Dim db As DAO.Database
Dim rs1 As DAO.Recordsets
Dim rs2 As DAO.Recordsets
Dim giaTri As Variant
Dim trungNhau As String
Set db = CurrentDb
Set rs1 = CurrentDb.OpenRecordset(qrydaxuat)
Set rs2 = CurrentDb.OpenRecordset(tbldanhap)
rs1.MoveFirst
Do Until rs1.EOF
giaTri = rs1.Fields("MaHH").Value
rs2.FindFirst "MaHH='" & giaTri & "'"
If Not rs2.NoMatch Then
trungNhau = trungNhau & giaTri & ", "
End If
rs1.MoveNext
Loop
rs1.Close
rs2.Close
db.Close
If Len(trungNhau) > 0 Then
trungNhau = Left(trungNhau, Len(trungNhau) - 2)
End If
MsgBox "Các giá tr? trùng nhau: " & trungNhau
End Sub
Noname > 23-06-23, 04:04 PM
ongke0711 > 23-06-23, 07:44 PM
(23-06-23, 03:45 PM)longkd_bvct@yahoo.com.vn Đã viết:Mã:...
Set rs1 = CurrentDb.OpenRecordset(qrydaxuat)
Set rs2 = CurrentDb.OpenRecordset(tbldanhap)
..
End Sub
Mọi người xem giúp em bị sai chổ nào mà khi chạy lại báo lỗi: "Method or data member not found" ạ