fields in forms that use other fields

S

sushi155

Hello. I have a problem and hope someone here might have a solution.
am building a form that will allow users to enter a company's name an
corresponding ID number. I already have a table that has thi
information. On my form I have a combo box where you can select th
company. THe ID number is on the same form and I want it to be fille
in automatically since each company has a unique ID number. HOw do
do this? Thanks in advance for the help
 
J

John Vinson

Hello. I have a problem and hope someone here might have a solution. I
am building a form that will allow users to enter a company's name and
corresponding ID number. I already have a table that has this
information. On my form I have a combo box where you can select the
company. THe ID number is on the same form and I want it to be filled
in automatically since each company has a unique ID number. HOw do I
do this? Thanks in advance for the help.

Are you trying to store both the ID and the company name in a second
table? If so, DON'T. Typically the user would never even need to SEE
the ID; you can use a combo box bound to the ID, but displaying the
company name. The combo box would have both fields; you can set the
width of the Id column to 0 so that it's there and stored, just not
displayed.

If for some reason you want to display both the name and the ID, you
can set the control source of a textbox on the form to

=comboboxname.Column(1)

to display the *second* column of the combo's rowsource query - it's
zero based.

John W. Vinson[MVP]
 
Top