J
jsteeves
I want to procedure that accepts an integer and appends the integer to a
control name in the code. Ex. of what I have:
Dim WhereMETH1 As String
WhereMETH1 = " SELECT lstTests.meth" & _
" FROM lstTests" & _
" WHERE lstTests.desc = """ & Me.cbotdesc1 & """" & _
" GROUP BY lstTests.meth;"
Debug.Print WhereMETH1
Me.cbotmeth1 = "" 'Clear cbo
Me.cbotunit1 = "" 'Clear cbo
Me.cbotunit1.RowSource = "" 'Clear cbo
Me.cbotunit1.RowSource = "" 'Clear cbo
Me.cbotmeth1.RowSource = WhereMETH1
-------
Dim WhereUNIT12 As String
WhereUNIT12 = " SELECT lstTests.unit" & _
" FROM lstTests" & _
" WHERE lstTests.desc = """ & Me.cbotdesc12 & """" & _
" AND lstTests.meth = """ & Me.cbotmeth12 & """" & _
" GROUP BY lstTests.unit;"
Debug.Print WhereUNIT12
Me.cbotunit12 = "" 'Clear cbo
Me.cbotunit12.RowSource = WhereUNIT12
The only difference is going to be the event which the procedures are bound
to, and the # suffix of the combo boxes. Could I do a procedure like-
public sub cbocascade(intNumber As Integer)
And append intNumber to the control names somehow? I need to do this to
about 15 controls and the way I have it set up lacks finesse.
control name in the code. Ex. of what I have:
Dim WhereMETH1 As String
WhereMETH1 = " SELECT lstTests.meth" & _
" FROM lstTests" & _
" WHERE lstTests.desc = """ & Me.cbotdesc1 & """" & _
" GROUP BY lstTests.meth;"
Debug.Print WhereMETH1
Me.cbotmeth1 = "" 'Clear cbo
Me.cbotunit1 = "" 'Clear cbo
Me.cbotunit1.RowSource = "" 'Clear cbo
Me.cbotunit1.RowSource = "" 'Clear cbo
Me.cbotmeth1.RowSource = WhereMETH1
-------
Dim WhereUNIT12 As String
WhereUNIT12 = " SELECT lstTests.unit" & _
" FROM lstTests" & _
" WHERE lstTests.desc = """ & Me.cbotdesc12 & """" & _
" AND lstTests.meth = """ & Me.cbotmeth12 & """" & _
" GROUP BY lstTests.unit;"
Debug.Print WhereUNIT12
Me.cbotunit12 = "" 'Clear cbo
Me.cbotunit12.RowSource = WhereUNIT12
The only difference is going to be the event which the procedures are bound
to, and the # suffix of the combo boxes. Could I do a procedure like-
public sub cbocascade(intNumber As Integer)
And append intNumber to the control names somehow? I need to do this to
about 15 controls and the way I have it set up lacks finesse.