Forms that read tables

  • Thread starter Thread starter wayno
  • Start date Start date
W

wayno

Please help!!! i have been lost for days!! i am trying to get
information on how to get one field in a form to show one detail . I.e
Name, and the other field to show the relevant information from the
table i.e phone number. i need to use a combo box to select the name,
and i want the phone number field to show the persons phone number
automaticly. i am a basic user so simple terms would be appreiciated.
Thanks Wayne
 
Wayne,
First, using the name field (ex. CustName) to locate related data is not good design.
Too much chance of legitimate duplicate names... Each CustName should have it's own key
field unique value, and all references to data associated with that CustName should be
determined via that unique CustID.
You should be using a CustID to identify a name and a phone number.
But, let's put that issue aside for right now... although it should be addressed.

I assume that the combo (ex. cboCustName) is bound to the CustName field of the table
you are updating. There is no need to save the PhoneNo, just "display" it. Never capture
a field value that can be re-derived from the CustName in any subsequent form, query, or
report.
Add the PhoneNO field to the query behind your combobox...
ex. John Davidson 666-666-6666

Place an unbound calculated field on your form (ex. txtPhoneNo) with this a sthe
ControlSource...
= cboCustName.Column(1)
Combobox columns are referred to as 0, 1, 2, 3, etc.. so CustName is in (0) and Phone
number is in (1)

Whenever you select a name from the combo, the associated PhoneNo will "display" in the
calculated field.
 

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

Back
Top