K
Ken
I have two tables. I'm trying to see if a record exists in my second table
using the FindFirst method. My first table (rec) is indexed but my second
table (rec1) is not. It could be, if needed.
Both 'MasterRecID' fields below are numbers, not strings.
After the FindFirst code executes, I receive the following error, "3251:
Operation not supported for this type of object"
Thanks for your help.
Dim rec As Recordset
Dim db As Database
Set db = CurrentDb()
Set rec = db.OpenRecordset("qryNADispensings1")
Dim rec1 As Recordset
Dim db1 As Database
Set db1 = CurrentDb()
Set rec1 = db1.OpenRecordset("tblNAReport")
If rec.EOF Then
rec.Close
MsgBox "No data", vbInformation, ""
Exit Sub
Else
rec.MoveFirst
Do
rec1.FindFirst "MasterRecID = " & rec("MasterRecID")
If rec1.NoMatch Then
MsgBox "No match!"
Else
MsgBox "match!"
End If
rec.MoveNext
If rec.EOF Then Exit Do
Loop
End If
using the FindFirst method. My first table (rec) is indexed but my second
table (rec1) is not. It could be, if needed.
Both 'MasterRecID' fields below are numbers, not strings.
After the FindFirst code executes, I receive the following error, "3251:
Operation not supported for this type of object"
Thanks for your help.
Dim rec As Recordset
Dim db As Database
Set db = CurrentDb()
Set rec = db.OpenRecordset("qryNADispensings1")
Dim rec1 As Recordset
Dim db1 As Database
Set db1 = CurrentDb()
Set rec1 = db1.OpenRecordset("tblNAReport")
If rec.EOF Then
rec.Close
MsgBox "No data", vbInformation, ""
Exit Sub
Else
rec.MoveFirst
Do
rec1.FindFirst "MasterRecID = " & rec("MasterRecID")
If rec1.NoMatch Then
MsgBox "No match!"
Else
MsgBox "match!"
End If
rec.MoveNext
If rec.EOF Then Exit Do
Loop
End If