Get combo box values into string array

  • Thread starter Thread starter waldo2k2
  • Start date Start date
W

waldo2k2

Guest
I'm populating a combo box from a query. I'm running a DCount on 2 criteria. The user selects the criteria from 2 combo boxes. If the user types * into the combo box, I want to be able to loop through each combination from the combo box values. I need to get the list of values from the combo box and put it into a string array, however it throws a type mismatch if I did something like
Code:
BRANCHES(x)=CStr(cboBranches(x)) 'cboBranches(x)=cboBranches.Value(x)
So I tried to run the sql from vb but found out that I can't return a string value from that (vb sucks). So I'm back to trying to get the values from the combo box. Any help would be appreciated.
 
Didn't get a thing after reading the post! Please rephrase. Also, please delete the duplicated post. Thank you.
 
sorry about the double post, internet hung while posting...

anyway, I'll try to explain this better:
2 sql queries (distinct entries from fields)-->2 combo boxes-->user enters * meaning check records that meet criteria from option 1 and options 1-x in second cbo, options 2 and options 1-x in second cbo, and so on-->vba code must now have the items in the cbo's which were pulled by the sql query

what I originally tried to do was run that sql statement in my code, but you can't return a string array from sql code in vba in access.
hopefully that's clearer.
 
waldo2k2 said:
...from option 1 and options 1-x in second cbo, options 2 and options 1-x in second cbo, and so on-->vba code must now have the items in the cbo's which were pulled by the sql query
...
I'm still in a cloud, don't understand your "options...1-x...". Sorry for my stupidity.
 

Users who are viewing this thread

Back
Top Bottom