Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a datalist from a datacombo box selection?

Status
Not open for further replies.

dsherrill

IS-IT--Management
Jul 6, 2001
18
0
0
US
I am a beginner so...
I want to populate a datalist when a user makes a selection in a dropdown datacombo box. The data is in two different access databases. I created an ado control for the combo box and the list box. This shouldn't be too difficult but it's eating my lunch.

thanks for any help
dsherrill
 
What does you code look like at present?
What actual problem are you having?
What does you data look like?

With these answers we can maybe help you Let me know if this helps

Check out FAQ222-2244
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
I set the adodc1 as the table.
Adodc2 as select text with SELECT * FROM Description;

Private Sub DataCombo1_Change()
'gets item selection from combo box
gstrItem = DataCombo1.Text
Dim strSQL As String
'combines SQL with the item selected in gstrItem
strSQL = "SELECT Item FROM Description " & _
"WHERE Category = " & Chr(34) & _
gstrItem & Chr(34)

Adodc2.RecordSource = strSQL
Adodc2.Refresh
DataList1.Visible = True
This works for me, I figured it out driving to work today.
Maybe this will help someone else.
Thanks,
Dsherrill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top