Combo Box values

  • Thread starter Thread starter Deborah
  • Start date Start date
D

Deborah

Ok, I have a combo box on one form that stores the unique
id in a table. On a second form I want to get the text
value that is the equivalent of the unique id gotten in
the first form. What is the syntax for doing so? In other
words I have a table with the unique id and a name. On the
first form I have a combo box that shows the name but
stores the value in yet another table. On a second form I
have picked something and need the name from the first
table. However, what is stored is the unique id value. How
do I get the name to appear as opposed to the unique id?

Thanks
 
-----Original Message-----
Ok, I have a combo box on one form that stores the unique
id in a table. On a second form I want to get the text
value that is the equivalent of the unique id gotten in
the first form. What is the syntax for doing so? In other
words I have a table with the unique id and a name. On the
first form I have a combo box that shows the name but
stores the value in yet another table. On a second form I
have picked something and need the name from the first
table. However, what is stored is the unique id value. How
do I get the name to appear as opposed to the unique id?

Thanks
.
Hi Deborah,
what is the relationship between the 2 forms - are they
open at the same time? does 1 open 2?

Jonathan
 
Ok, I have a combo box on one form that stores the unique
id in a table. On a second form I want to get the text
value that is the equivalent of the unique id gotten in
the first form. What is the syntax for doing so? In other
words I have a table with the unique id and a name. On the
first form I have a combo box that shows the name but
stores the value in yet another table. On a second form I
have picked something and need the name from the first
table. However, what is stored is the unique id value. How
do I get the name to appear as opposed to the unique id?

Assuming that the second column in that combo box displays the "name" (the first
column containing the "id" value and whose columnwidth value is set to zero),
you can try the following syntax:

Forms!Form1Name.ComboBoxName.Column(1)

You will need to replace "Form1Name" with the name of the first form and
"ComboBoxName" with the name of the combo box on the first form. Combo box
columns are "zero-indexed", meaning that the columns are indexed starting at
zero, so "Column(1)" points to the second column in the combo box.

If this doesn't work for you, post back with more information about the combo
box and the table from which its rowsource is derived.
 
Jonathan
No real relation except that they both call on the same
table. The person entering data, can (and will) enter data
on the first form and then come back in a couple of days
and open the second form to add further data. Basically
the first form is sort of a look up table so that the
second form has preset information available.

Deborah
 
Debroah,
when creating the combobox have the wizard lookup the
values from the names table - id and name fields. Have the
column width for the id set to 0 (zero). Have the combobox
bound to the id field of the 2nd form/table.

Users will then enter/select a name using the combobox and
have the id stored in bound field.

Luck
Jonathan
 
Back
Top