G
Guest
Hi
I have a subform with a Yes/No check box (Tag)
When this is clicked the current date is entered in the Date field and the
key field PupilID from the main form is saved. This works fine using:
Private Sub Tag_Click()
Me.PupilID = Forms!SENReview.PupilID
Me.Date = Now()
End Sub
I also want the Date field to be made blank if the Tag box is unchecked.
I've tried variations on the following code:
Private Sub Tag_AfterUpdate()
If Me.Tag = "No" Then
Me.PupilID = Forms!SENReview.PupilID
Me.Date = Now()
Else
Me.Date = ""
End If
End Sub
This has no effect in AfterUpdate event.
Placing this code as a BeforeUpdate event causes an error.
Using it in the Click event prevents the date being saved at all!
Ideas please on how to solve what ought to be very simple to do!
I have a subform with a Yes/No check box (Tag)
When this is clicked the current date is entered in the Date field and the
key field PupilID from the main form is saved. This works fine using:
Private Sub Tag_Click()
Me.PupilID = Forms!SENReview.PupilID
Me.Date = Now()
End Sub
I also want the Date field to be made blank if the Tag box is unchecked.
I've tried variations on the following code:
Private Sub Tag_AfterUpdate()
If Me.Tag = "No" Then
Me.PupilID = Forms!SENReview.PupilID
Me.Date = Now()
Else
Me.Date = ""
End If
End Sub
This has no effect in AfterUpdate event.
Placing this code as a BeforeUpdate event causes an error.
Using it in the Click event prevents the date being saved at all!
Ideas please on how to solve what ought to be very simple to do!