Beginners SQL in VBA help

T

t

Hello,
I have a table that has many columns. One is for the county code and
another is for names of each rep for each county. I want to right an sql
that whenever I choose the county code (which is housed on a combo box onthe
form) that the corresponding name would pop in my label. I can take care of
the label stuff but need help with the sql. Whatever sql i tried is not
working.
Can someone help?
Table Name-RepTable
Fields - CountyCode and RepName.
Thanks.
 
P

pietlinden

Hello,
I have a table that has  many columns. One is for the county code and
another is for names of each rep for each county.  I want to right an sql
that whenever I choose the county code (which is housed on a combo box onthe
form) that the corresponding name would pop in my label.   I can take care of
the label stuff but need help with the sql. Whatever sql i tried is not
working.  
  Can someone help?
Table Name-RepTable
Fields - CountyCode and RepName.
Thanks.

you don't need one. If you include the corresponding name in the
rowsource for the combobox (so it will have two columns instead of
just one), you can set the width of the rightmost column to 0, and
then set the control source of your textbox to
=cboCountyCode.Columns(1)

The columns collection is zero-based, so numbering starts at zero...
 

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