docmd.openform where condition

Gina

Registered User.
Local time
Yesterday, 23:14
Joined
Apr 15, 2000
Messages
30
I am once again having syntax issues with the following statement. I have tried all variations of single ticks and quotes, HELP !!!!! I can get the two statements to work separately, but when I add the "AND" it fails.

The "RecordLock" field is a yes/no field.

stLinkCriteria = "[RecordLock]=No AND [Analysts]='" & StaffUserID() & " ' "
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acWindowNormal, "Edit"

Thank You
gina
 
if StaffUserID() is a field on your form and is also a number then you don't need quotes for it:
stLinkCriteria = "[RecordLock]=No AND [Analysts]=" & StaffUserID()

- the brackets make it look like a function??
 
StaffUserID() is a function
 
I got it; too many quotes

stLinkCriteria1 = "[RecordLock]=No And [Analysts]=" & StaffUserID()
 

Users who are viewing this thread

Back
Top Bottom