Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pivot table from recordset - very slow performance [email protected] Charts and Charting in Excel 1 May 14th 06 04:05 PM
what is an argument? mcockrel Excel Discussion (Misc queries) 7 March 17th 06 03:21 PM
FindFirst, FindLast and select Noemi Excel Discussion (Misc queries) 2 February 2nd 06 03:46 AM
One more Argument. Steved Excel Worksheet Functions 1 July 28th 05 08:55 AM
return recordset Laurent M Excel Discussion (Misc queries) 4 January 26th 05 09:43 AM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"