
ADO and Bound Data Combo Control Question - NEWBIE
In the AfterUpdate or Click event of combo1, set the .RowSource of combo2:
Dim strSQL As String
strSQL = "SELECT * FROM tblZipCodes WHERE lngStateID=" & Me.Combo1.Column(0)
Me.combo2.RowSource = strSQL
Of course, you'll have to change the names to match those on your
form/tables.
Scott McDaniel
CS Computer Software
Always looking for contract work ...
Hi all...
I am doing a DB application using MS-Access 2000. I have a form in which I
have 2 data combo controls. The first is querying a table and getting
results back to populate the combo box. I need the second one to be
populated based upon the choice that the user selects from the first one. Is
there any way to do this? The query to populate the 2nd combo box will need
a value supplied from the first. (Essentially doing lookups, you know, like
if state selected is CA, then list only the CA Zip codes in the 2nd combo).
Each control pulls values from separate tables, so there is no exact same
field being used. I have a foreign key linking the tables, so the 1st combo
box selection can provide that the the query for the 2nd box. I have Querys
set up in Access to accomplish this, but am lost trying to get it done in VB
6.
Any help is GREATLY appreciated!!!
Scott