Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Coding using ADO control

Status
Not open for further replies.

OpelFruit

Computer
Oct 16, 2002
2
I am currently using an ADO control with visual basic.

This piece of code is *supposed* to display the fields of ClickChoice (what i clicked in the list box) in another list box. However it seems I can't use the variable ClickChoice when trying to connect the DB (AdoFilterSearch.Recordset!ClickChoice) - since it wants the exact field name instead of ClickChoice (for example Title).
Any ideas on how I can put the variable in this piece of code?

Code:
Dim ClickChoice
ClickChoice = AdoFilterSearch.Recordset.Fields(Index).Name
AdoFilterSearch.Recordset.MoveFirst
Do Until AdoFilterSearch.Recordset.EOF
'CboFilterBox(2).AddItem (AdoFilterSearch.Recordset!
ClickChoice)
 
Replies continue below

Recommended for you

Since ClickChoice is a variable
AdoFilterSearch.Recordset!ClickChoice will not work
Use AdoFilterSearch.Recordset(ClickChoice)
 
Thank you. I noticed the adofiltersearch.recordset.fields(ClickChoice).value - (or close to that) about 2 hours after i'd posted!

Again, thanks for your help, i now have a very nice filter search working!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor