DLookup on Text Box

S

Sydious

I am trying to use DLookup to populate a text box on my form. I am failing at
all levels to get this to work. Could someone please help me?



The form name is [frmOT_Forecast_Output]

I want to use a combo box to select an Employee. This cmbo box is named
[cmboLTLPicker_01]

Once the employee is selected in the [cmboLTLPicker_01], a text box named
[LTL_PPH_01] is populated with data from the field called[LTL_PPH] from query
named [qryEmployee_Performances].

I read I need to put a =DLookup in the control source of the text box I want
populated on my form.

Can anyone help me write this?
 
K

Klatuu

The better way to do this is to use the After Update event of the combo box
to populate the text box.

Private Sub cmboLTLPicker_01_AfterUpdate()

Me.LTL_PPH_01 =
DLookup("[LTL_PPH]","qryEmployee_Performances","EMPLOYEE_ID = " &
Me.cmboLTLPicler_01

This part:
"EMPLOYEE_ID = " & Me.cmboLTLPicler_01
I can't be sure of because I don't know what fields are in the table or what
the combo returns, but you can straighten that out.
 

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