Hello all,
I have some code that I want to run on a few combo boxes located on the same form. Instead of copying the code for as many combo boxes I have, I wanted to load all of the combo boxes into an array, and then iterate through that array while running the code.
Problem is I can't figure out how to do this programmatically (I'm hoping its just syntax errors)
This is the current test that I'm kicking around...
*** This Works ***
Dim myArray(0) as Variant
Dim fubar as Integer
myArray(0) = 10
fubar = myArray(0)
msgbox fubar
***
*** This Doesn't Work ***
Dim myArray(0) as Variant
Dim fubar as Access.ComboBox
myArray(0) = Me.cmbYear 'cmbYear exists and contains data
fubar = myArray(0)
msgbox fubar.value
***
Any help would be appreciated.
Thanks in advance,
FUBAR
I have some code that I want to run on a few combo boxes located on the same form. Instead of copying the code for as many combo boxes I have, I wanted to load all of the combo boxes into an array, and then iterate through that array while running the code.
Problem is I can't figure out how to do this programmatically (I'm hoping its just syntax errors)
This is the current test that I'm kicking around...
*** This Works ***
Dim myArray(0) as Variant
Dim fubar as Integer
myArray(0) = 10
fubar = myArray(0)
msgbox fubar
***
*** This Doesn't Work ***
Dim myArray(0) as Variant
Dim fubar as Access.ComboBox
myArray(0) = Me.cmbYear 'cmbYear exists and contains data
fubar = myArray(0)
msgbox fubar.value
***
Any help would be appreciated.
Thanks in advance,
FUBAR