Form Question - New User

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I run W2K with Access 2K

I have a table that has 2 columns in it. The first column contains unique
numbers that I have made the primary key. The second column has a different
paint colour for each unique number.

I have a form that I have placed a combo box that lets me scroll down and
pick the number I want.

I would like to have a field next to the combo box that automatically
displays the colour that the number represents.

If this is down using a Lookup or a Query I have no idea how to do this so I
would very much appreciate an explanation if possible.

Thanks

John
 
Hi John,

Assuming that your combo box is returning both the primary key and the
colour (if it isn't , update the data source query so that it does), you can
simply have a text box with its data source set to
"=me.cboComboBoxName.column(1)" where cboComboBoxName is the name of your
combo box.

This will display the selected item in your combo box, and its colour in the
text box.

Of course, you might like to check for nulls or whatever to make it tidier,
such as this... "=iif(isnull(me.cboComboBoxName), "",
me.cboComboBoxName.column(1))"

Hope this helps.

Damian.
 
Damien

Thanks for your prompt response. My combo box only shows the unique number
and not the paint colour. I would like the paint colour to automatically show
in a different box depending on which number I choose in the combo box.

Thanks
 
Alright, see my original post...

You need to ensure that the query/datasource behind your combo box is
returning both fields. Naturally only one field is showing when you select
it - this is how combo boxes work.

My original reply tells you how to display the other field in a separate
text box.

Damian.
 
Back
Top