Hello,
I have been searching for awhile and can't quite make this work for me. Would anyone have an idea why.
And before I go on, everything I have read says to put the code on the Form's "Before Update" event but I have Audit Trail code there and can't seem to add additional code or maybe I am just not doing it correctly. I have some code in the DB (audit trail being the big one), but that was with help from people such as yourself.
Here is my issue:
I have a form, and a field called "PendingAction" which is a checkbox and if it is set True, I want to make the "PendingActionDate" required meaning they have to put in a date or they can't exit but can't seem to make it work.
I would like to use the OnClick property of the Pending Action checkbox…is that doable?
Any help would be appreciated…I have tried.
Currently, I have the below and it will give a message when I check the box but doesn't require the user to fill in the date before exiting the form.
This is on the OnClick Event of the checkbox:
Private Sub PendingAction_Click()
If Nz(Me.PendingActionDate, "") = "" Then
Cancel = True
MsgBox "Pending Action Date is required, please fill in the date.", vbExclamation, "Data Required"
End If
End Sub
Thank your for any help.
Lilly
I have been searching for awhile and can't quite make this work for me. Would anyone have an idea why.
And before I go on, everything I have read says to put the code on the Form's "Before Update" event but I have Audit Trail code there and can't seem to add additional code or maybe I am just not doing it correctly. I have some code in the DB (audit trail being the big one), but that was with help from people such as yourself.
Here is my issue:
I have a form, and a field called "PendingAction" which is a checkbox and if it is set True, I want to make the "PendingActionDate" required meaning they have to put in a date or they can't exit but can't seem to make it work.
I would like to use the OnClick property of the Pending Action checkbox…is that doable?
Any help would be appreciated…I have tried.
Currently, I have the below and it will give a message when I check the box but doesn't require the user to fill in the date before exiting the form.
This is on the OnClick Event of the checkbox:
Private Sub PendingAction_Click()
If Nz(Me.PendingActionDate, "") = "" Then
Cancel = True
MsgBox "Pending Action Date is required, please fill in the date.", vbExclamation, "Data Required"
End If
End Sub
Thank your for any help.
Lilly