Automatically suggest field value

G

Guest

I have a form with clients’ data (clientID, clienteName, etc.).
I need the field clientname to be automatically filled after the user tapes
clientid.
Clientid is a 1 column combo box and it looks for data on clients table.

Any help is most welcome.
 
R

ruralguy via AccessMonster.com

Replace your ComboBox with a new one and this time let the wizard "Find a
Record" on your form.
 
J

J. Goddard

Try the Dlookup function in the After Update event of the ClientID:

me!clientname = dlookup("ClientName", "Clients", "ClientID = " &
me!ClientID)

But why not make the combo box list the Client Name, with the ClientID a
hidden column? You can sort the data in the combo box any way you like,
and the AutoExpand property allows users to find the corret entris faster.

John
 
J

John Vinson

I have a form with clients’ data (clientID, clienteName, etc.).
I need the field clientname to be automatically filled after the user tapes
clientid.
Clientid is a 1 column combo box and it looks for data on clients table.

Any help is most welcome.

Just to add to John and ruralguy's suggestions, just be aware that if
you're trying to copy the client name from the Clients table into some
other table - you *should not do so*. There is NO need to store the
client name redundantly in a second table, and it violates the basic
principles of relational database design to do so!

John W. Vinson[MVP]
 

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