I have a bound date textbox and a bound checkmark on a form. If someone types in a date and then tries to put in a checkmark on the same record, a message should come up telling them they can't do that and the same if they have a checkmark in and try to add a date on the same record. My code is not doing what I want.
'If a checkmark is selected, it checks to make sure Date is null; if not shows message.
Private Sub NoDate_LostFocus()
If Me!Date <> Null Then
MsgBox "A date has been put in above. Verify that there really is not a date for this section. If there is no date, you must erase the date above before putting in a check mark for no date."
End If
End Sub
'If a date is entered, it checks to make sure NoDate is null; if not shows message.
Private Sub Date_LostFocus()
If Me!NoDate <> Null Then
MsgBox "You must take out the check mark from 'No Date Shown' before you can enter a date here."
End If
End Sub
Can someone please tell me why it is not working? Thanks for the help, JL
'If a checkmark is selected, it checks to make sure Date is null; if not shows message.
Private Sub NoDate_LostFocus()
If Me!Date <> Null Then
MsgBox "A date has been put in above. Verify that there really is not a date for this section. If there is no date, you must erase the date above before putting in a check mark for no date."
End If
End Sub
'If a date is entered, it checks to make sure NoDate is null; if not shows message.
Private Sub Date_LostFocus()
If Me!NoDate <> Null Then
MsgBox "You must take out the check mark from 'No Date Shown' before you can enter a date here."
End If
End Sub
Can someone please tell me why it is not working? Thanks for the help, JL