I have a form that has a combo box where I check to see if a field in the header is filled in, if it is not I want an error message to come up and tell the user to enter a period. This works fine if I put the code in the On Got Focus Event. The problem is that when I open the form I get the message that they need to enter the period. I tried the Before Update Event and then it will not take the user to the Period field after they click OK.
Here is my code;
Private Sub AccountNumberSelect_GotFocus()
If IsNull([PeriodSelect]) Then
Dim LResponse As Integer
LResponse = MsgBox("Please Enter a Period from Above!", vbYes, "Enter Period")
Not sure where it would work best, like I said on Got Focus works fine except the message comes up when they open the form.
Thanks in advance.
DoCmd.GoToControl "PeriodSelect"
End If
End Sub