Beginners SQL in VBA help

  • Thread starter Thread starter t
  • Start date Start date
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.
 
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...
 
Back
Top