I'm attempting to call a subprocedure from within a FOR statement. Which procedure is called depends on which iteration of the loop it's currently on. the chkPLA/PM/CAM are check boxes. If its checked, then it would call the sub procedure related to that category. The Call portion is what is currently broke. It is telling me i must list call a function or procedure when i run it. I'm sure this hs something to do with how i've declared the variable, but i'm not sure which type is correct in this situation.
The code i currently have is:
The code i currently have is:
Code:
Private Sub Command11_Click()
Dim strChkID(2) As String
Dim strCallSubName(2) As String
strChkID(0) = Me.chkPLA
strChkID(1) = Me.chkPM
strChkID(2) = Me.chkCAM
strCallSubName(0) = "ExportPLA"
strCallSubName(1) = "ExportPM"
strCallSubName(2) = "ExportCAM"
For Counter = LBound(strChkID) To UBound(strChkID)
If strChkID(Counter) = True Then
[B][COLOR=red] Call strCallSubName(Counter)[/COLOR][/B]
End If
Next
End Sub