Trying to open a form to specific records

What is wrong with this syntax?

DoCmd.OpenForm "frmTimeSheetHeader", acNormal, , , [EmployeeN] = DLookup("[dbUserID]", "LOCALtblCurrentUSer"), acWindowNormal
SteveL13Asked:
Who is Participating?
 
SteveL13Author Commented:
I finally got it with:

DoCmd.OpenForm "frmTimeSheetHeader", acNormal, , "[EmployeeN] = " & DLookup("[dbUserID]", "LOCALtblCurrentUSer"), acFormEdit, acWindowNormal

Open in new window

1
 
bfuchsCommented:
Try remove brackets.
DoCmd.OpenForm "frmTimeSheetHeader", acNormal, , , [EmployeeN] = DLookup("dbUserID", "LOCALtblCurrentUSer"), acWindowNormal

Open in new window

Also what error message are you getting?
Is EmployeeN a number field or text?
0
 
SteveL13Author Commented:
Because my re-written code worked.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.