I have created a form with a 'OK' button and a 'Cancel' button. Alongwhich, there are 2 combo boxes which allows the user to choose the month and year respectively.
I have written a error checking VBA code to produce an error message if the user did not choose either of the boxes.
p = Format(Form.ComboMonth.Value, "mm")
r = Form.ComboYear.Value
If (p = "") Or (r = "") Then
MsgBox "Please Input the required Month and Year."
Exit Sub
End If
however, the form will be unloaded and i have to go into the program again. is there any way to replace the "Exit Sub" statement, such that after the error message is displayed and the user clicks the 'OK' button, it returns back to the form to allow the user to choose the month and year inputs from the form again?
thx for any inputs
Bookmarks