G
Guest
I am trying to write a simple procedure to be sure a selection has been made
from a combo box. I would like to call the procedure from the click event of
each button on a form.
My code is
Sub ValidatePeriod()
If IsNull(Combo1) Then
MsgBox "You must select a Month"
Combo1.SetFocus
Else
If Not IsNull(Combo1) Then
Exit Sub
End If
End If
End Sub
After I click OK on the message box the code drops through and continues the
event, without allowing the chance to select a choice. This code works fine
if I put in each procedure, which I am trying to avoid doing.
from a combo box. I would like to call the procedure from the click event of
each button on a form.
My code is
Sub ValidatePeriod()
If IsNull(Combo1) Then
MsgBox "You must select a Month"
Combo1.SetFocus
Else
If Not IsNull(Combo1) Then
Exit Sub
End If
End If
End Sub
After I click OK on the message box the code drops through and continues the
event, without allowing the chance to select a choice. This code works fine
if I put in each procedure, which I am trying to avoid doing.