Populate form field with a DLookup

I should know how to do this but I'm drawing a blank.  I have a field on a form.  Its record source is a field in the bound table.  I want to populate it and have it drop in the field in the table with a DLookup like:

=DLookUp("[dbUserID]","LOCALtblCurrentUser")

but I can't figure out where to put that code.  I've tried the onopen event of the form and also the beforeupdate event of the form but it doesn't work.

Any help much appreciated.
SteveL13Asked:
Who is Participating?
 
PatHartmanCommented:
1.  When the ControlSource of a control starts with an equal sign, the control is NOT BOUND.  It is calculated and so by definition unbound.
2.  The BeforeUpdate event of the form is the correct place to set the value for this field:

Me.ChangedBy = DLookUp("[dbUserID]","LOCALtblCurrentUser")
0
 
SteveL13Author Commented:
Perfect.  Thanks.
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.