Auto Populate a Field

C

Confused Slug

I have a 'Main Record' form that has on it a 'Contact Person' combo box and a
'Phone Number' field. The 'Contact Name' combo draws its information from a
seperate table, 'Default Details', that contains a list of names (and the
associated phone numbers). The value selected in the combo box is stored in
the table associated with the Main Record form.

When the record changes in the 'Contact Name' combo i would like the 'Phone
Number' field on the 'Main Record' form to auto populate with the associated
phone number held in the 'Default Details' table, saving the information in
the 'Main Record' table. The user should be free to amend this phone number
but in doing so this should not change the default information, only the
information stored in the 'Main Records' table.

I am unsure how to code this, Do....Loop ????


Thanks
Confused
 
J

Jack Leach

In the AfterUpdate event of Contact Name, use DLookup (or see
AllenBrowne.com/tips.html and search for the better ELookup replacement) to
get the value you want. Either the Help or Allen's documentation will
describe how to use DLookup or ELookup, repsectively.

hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 

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