Textbox Query Question

K

Kim

I have a form called "Daily Appointments" and would like to use
textbox "Phone Number" to query and populate textbox "Client Name".

Textbox "Client Phone" has control source from table "All
Appointments"; field "Phone".
I would like to use textbox "Client Phone" to get client name from
table "Client Information"; field C_Name and populate textbox "Client
Name".

I am a novice VB and Access programmer, so a specific and detail
response would really be appreciated.

Thank you in advance.
 
K

Ken Snell

If you just want to display the Client Name, you could use the DLookup
function in the control source for th "Client Name" textbox. Something like
this, perhaps:

=DLookup("Client Name", "All Appointments", "[Phone Number]=" & [Phone
Number])

Above assumes that the field Phone Number in the table is a numeric field.
If it's a text field, then you need to delimit the last part with '
characters:

=DLookup("Client Name", "All Appointments", "[Phone Number]='" & [Phone
Number] & "'")
 

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