H
Hendy88
Hello all! I have the following code and no matter how I change it
around, even though the access table is COMPLETELY empty, it still
seems to think the record exists in my Access Database table and
always kicks off to the MsgBox "Record Found in Table". So either
the .FindFirst isn't working or there another way to rewrite it so it
does work.
Dim AccessDB As Database
Dim AccessRecordSet As Recordset
Dim FindThis As String
Set AccessDB = OpenDatabase("C:\MyDatabase.mdb")
Set AccessRecordSet = AccessDB.OpenRecordset("MyTable",
dbOpenTable)
FindThis = Range("A1").Value
On Error Resume Next
With AccessRecordSet
.FindFirst "[Field1]= '" & FindThis &"'"
If AccessRecordSet.NoMatch Then
MsgBox "Record Not Found in Table"
Else
MsgBox "Record Found in Table"
End If
End With
Again, I've cleared the entire contents of the Access table to test
whether or not the .FindFirst was actually working and it still tells
me that a record WAS found. I'm at a loss.
around, even though the access table is COMPLETELY empty, it still
seems to think the record exists in my Access Database table and
always kicks off to the MsgBox "Record Found in Table". So either
the .FindFirst isn't working or there another way to rewrite it so it
does work.
Dim AccessDB As Database
Dim AccessRecordSet As Recordset
Dim FindThis As String
Set AccessDB = OpenDatabase("C:\MyDatabase.mdb")
Set AccessRecordSet = AccessDB.OpenRecordset("MyTable",
dbOpenTable)
FindThis = Range("A1").Value
On Error Resume Next
With AccessRecordSet
.FindFirst "[Field1]= '" & FindThis &"'"
If AccessRecordSet.NoMatch Then
MsgBox "Record Not Found in Table"
Else
MsgBox "Record Found in Table"
End If
End With
Again, I've cleared the entire contents of the Access table to test
whether or not the .FindFirst was actually working and it still tells
me that a record WAS found. I'm at a loss.