This is how I would do this. I would add an unbound combo box to my form
with it's row source being the customer table. I would have a column for
each of the 4 fields in the row source, but make all except the customer ID
invisible. Then in the After Update event of the combo, I would assign the
value of each column to the corresponding text box on the form.
Also, I would make the text boxes involved Not enabled and Locked so
incorrect values can't be entered.
This does a couple of things for you. It validates the customer ID you
entered, and make loading the text boxes easier. You can also use the
combo's Not In List event to warn the user of an invalid entry and allow them
to create a new customer record, if necessary.
If you need more detail, please post back
--
Dave Hargis, Microsoft Access MVP
"Sara" wrote:
> Hello,
>
> I need help with a data entry form that should bound to a table called
> "Inquiries", I have 4 text boxes on the form, one is a text box where the
> user enters the customer ID, then after the user enters the the customer ID
> the other 3 boxes automatically should populate with the name, phone number,
> and email, this information comes from a "customer" table. What is the best
> way to accomplish this?
> I appreciate your help
|