The problem is that I need to check combo boxes against each other. I did most of the work, but I don't know what to do about blank boxes. Code is below.
In the first "If" I need something for it to do in order to skip and go on to Next j...such as a Null. But you can't just write null there.![]()
Dim j As Long For j = 1 To 15 If Me.Controls("cmbVol" & j).Value = BLANK Then Else If j > 1 Then Dim q As Long For q = 1 To (j - 1) If Me.Controls("cmbVol" & j).Value = Me.Controls("cmbVol" & q).Value Then MsgBox "Yep you did it again" Exit Sub End If Next q Dim w As Long For w = (j + 1) To 15 If Me.Controls("cmbVol" & j).Value = Me.Controls("cmbVol" & w).Value Then MsgBox "Yep you did it this time" Exit Sub End If Next w Else Dim e As Long For e = 2 To 15 If Me.Controls("cmbVol" & j).Value = Me.Controls("cmbVol" & e).Value Then MsgBox "Ok Still it" Exit Sub End If Next e End If Next j
Or I can reverse the code and use the first if as Not Blank, but I also don't know how to do that.
Any help is appreciated.
Extra info:
Combo boxes are named "cmbVol1" - "cmbVol15"
They cannot be equal to each other but will not always be filled in. Most of the time there will be some blank ones.
The goal is to make sure that anything that does have info in it is not the same as something in another box and if so msgBox with message that says so.
Bookmarks