how to cycle through form combo boxes

D

Daniel M

I have a form with combo boxes on it that i need to programatically cycle
through and i need some help.

on the form i have the following combo boxes
cmbo1
cmbo2
cmbo3

each combobox has the source that is a query returning a number value. i
simply return cmbo1.value to the report it works fine. but what i would like
to do is loop through this.

i would like to pull cmbox.value and loop through x.

Can someone give me some guidance on how to do this?

I tried:
for x = 1 to 3
msgbox cmbo & x.value
next x

this gives me Object required error.

if i just do msgbox cmbo & x i get a value of "1" or x but not "cmbo1".
I can do msgbox "cmbo" & x to get "cmbo1" but then i cant get the value.

I'm somewhat of a new at this so any suggestions would be great. thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top