G
Guest
This drives me crazy. Someone tried to help me with the code for date check
on a subform, but I must not be getting something there.
Date is entered into the combo box on the form via a pop-up calendar (this
works fine. I got this from Martin Green website
http://www.fontstuff.com/access/acctut09.htm).
The problem is in the code of Before Update Event of the combo box:
If Not IsNull(DLookup("[School_Date]", "tabDemerits", "[School_Date]
= #" & Me.cboSchool_Date & "#" Then
MsgBox "Attendance for " & Me.School_Date & " Already Recorded"
Cancel = True
End If
The code above will check to see if the date is already recorded. If the
DLookup does not return Null, that means the date is recorded. If so, the
message box will be displayed, the update will be canceled, and the cursor
will remain in the date control.
Table name [tanDemerits], field name in that table [School_Date], combo box
in the subform where date is entered [cboSchool_Date]
Help anyone?
Thanks
JPol
on a subform, but I must not be getting something there.
Date is entered into the combo box on the form via a pop-up calendar (this
works fine. I got this from Martin Green website
http://www.fontstuff.com/access/acctut09.htm).
The problem is in the code of Before Update Event of the combo box:
If Not IsNull(DLookup("[School_Date]", "tabDemerits", "[School_Date]
= #" & Me.cboSchool_Date & "#" Then
MsgBox "Attendance for " & Me.School_Date & " Already Recorded"
Cancel = True
End If
The code above will check to see if the date is already recorded. If the
DLookup does not return Null, that means the date is recorded. If so, the
message box will be displayed, the update will be canceled, and the cursor
will remain in the date control.
Table name [tanDemerits], field name in that table [School_Date], combo box
in the subform where date is entered [cboSchool_Date]
Help anyone?
Thanks
JPol