SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,126
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi All
I'm trying to make my code a little more compact
Take the example below
I have loads of comboboxes to cycle through, well, about 36 and growing, now i could write the below out 36 times, but
could i not just loop like the below??
If i can i cannot work out how to actually write it.
thanks for your help
Dave
I'm trying to make my code a little more compact
Take the example below
I have loads of comboboxes to cycle through, well, about 36 and growing, now i could write the below out 36 times, but
VBA Code:
If Me.C1 <> "" Then
If Me.C1C = "" Or Me.C1CC = "" Then MsgBox "MISSING INFOR A CRITERIA 1"
End If
If Me.C2 <> "" Then
If Me.C2C = "" Or Me.C2CC = "" Then MsgBox "MISSING INFOR A CRITERIA 2"
End If
could i not just loop like the below??
If i can i cannot work out how to actually write it.
VBA Code:
dim a(1 to 36) as integer
for a = 1 to 36
If Me.C(a) <> "" Then
If Me.C(a)C = "" Or Me.C(a)CC = "" Then MsgBox "MISSING INFOR A CRITERIA " & a
End If
next a
thanks for your help
Dave