NoMatch now throws error

K

kenrav

I recently upsized my BE from .accdb to SQL Server 2008 Express. Prior to
doing this, the following code worked fine if no record was found:

Set rec = db.OpenRecordset("tblLockedOutUsers", dbOpenDynaset, dbSeeChanges)
rec.FindFirst "Username = '" & Me.UserName & "'"
If rec.NoMatch Then
rec.Close
Set rec = Nothing
Set db = Nothing
Else
'Match! Process data

However, now, I immediately get an error 3021: No current record error.

Any advice? Thanks.
 
P

PieterLinden via AccessMonster.com

kenrav said:
I recently upsized my BE from .accdb to SQL Server 2008 Express. Prior to
doing this, the following code worked fine if no record was found:

Set rec = db.OpenRecordset("tblLockedOutUsers", dbOpenDynaset, dbSeeChanges)
rec.FindFirst "Username = '" & Me.UserName & "'"
If rec.NoMatch Then
rec.Close
Set rec = Nothing
Set db = Nothing
Else
'Match! Process data

However, now, I immediately get an error 3021: No current record error.

Any advice? Thanks.

Can Seek/FindFirst be used on non-local tables? That might be the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top