DLookUp

  • Thread starter AccessUser777 via AccessMonster.com
  • Start date
A

AccessUser777 via AccessMonster.com

hello all,
I'm trying to use the DLookUp functions on a form but it doesn't seem to work
for me...I'm new at this so forgive my ignorace. the code I'm using is below:


Private Sub AGENT_AfterUpdate()
me.AGENT_NAME=Dlookup("name","tbl_CCS_agents_qcpid","Agent="&Forms!
[frm_CCS_Escalation]!qcp id)
End Sub

AGENT is a text box where the user enters a text id and AGENT NAME is also a
text box which I want to populate based on what the user entered in AGENT.
Any help is appreciated. Thanks.
 
D

Douglas J. Steele

Because you have spaces in the field name, you need to enclose the name in
square brackets:

Private Sub AGENT_AfterUpdate()
me.AGENT_NAME=Dlookup("name","tbl_CCS_agents_qcpid", _
"Agent="&Forms![frm_CCS_Escalation]![qcp id])
End Sub

Realistically, using special characters (which includes spaces) is not
recommended.
 

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