Trying to open a form to specific records

What is wrong with this syntax?

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

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

Open in new window

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?
SteveL13Author Commented:
Because my re-written code worked.
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.