Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Recordset.FindFirst argument not working...
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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
pivot table from recordset - very slow performance | Charts and Charting in Excel | |||
what is an argument? | Excel Discussion (Misc queries) | |||
FindFirst, FindLast and select | Excel Discussion (Misc queries) | |||
One more Argument. | Excel Worksheet Functions | |||
return recordset | Excel Discussion (Misc queries) |