Having trouble tracking down an error.
I have a form, when a textbox or combobox IsNull or "" then label.forecolor = labelcolor (which is declared variable) and setfocus to blank text/combobox when the "Add Record" button is pushed.
Code:
Running the form, leave the text/combo blank and press button it will give me msgbox then after msgbox is cleared then Microsoft Access gives me a msgbox saying "You can't go to the specified record".
What up?
And thanks!
I have a form, when a textbox or combobox IsNull or "" then label.forecolor = labelcolor (which is declared variable) and setfocus to blank text/combobox when the "Add Record" button is pushed.
Code:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Pain_Date1 = "" Or IsNull(Pain_Date) Then
Me.Pain_Date1.SetFocus
MsgBox "All fields in this audit are required."
DoCmd.CancelEvent
Me.Pain_Date_Label.ForeColor = vbRed
Exit Sub
End If
Running the form, leave the text/combo blank and press button it will give me msgbox then after msgbox is cleared then Microsoft Access gives me a msgbox saying "You can't go to the specified record".
What up?
And thanks!