Hi,
I've been searching for over 3 hours now to achieve qomething quite simple (or so I thought).
Attached sheet is an example. In cbomaand1 you need to enter the first month (eg 1 for January).
In cbomaand2 you enter the second month (eg 9 for September). I will use this to get a list of orders from lthe selected months.
Now, if cbomaand1 is October (10) and cbomaand 2 is January (1), I want to display a msgbox. of course, when you first start the userform, cbomaand 2 will be blank. If you give cbomaand1 a value, it will result in a msgbox. Therefor, I used this code:
Private Sub cbomaand1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call cijfersenmaandena
If cbomaand2.Value <> "" Then
If cbomaand1.Value > cbomaand2.Value Then
Cancel = True
MsgBox "De periode 'van' valt voor de periode 'tot'. Gelieve dit te corrigeren", vbExclamation
'cbomaand2.SetFocus
Else
'nix doen
End If
Else
'nix doen
End If
End Sub
The problem is, I don't receive a msgbox if both comboxes are filled in and I'm starting to change the months in cbomaand1.
Could someone please help me out, it's driving me mad...
Bookmarks