I am having trouble with one text field on my form. It is not inserting the current date into [EntryDate] when a new record is inserted. The two lines above it work perfectly but the text field bound to EntryDate is left blank. I don't get any errors and I tried all combinations of Enabled and locked data properties. Any help would be greatly appreciated.
Code:
Private Sub Form_AfterInsert()
Me.[OldBox#] = DMax("Val([OldBox#])", "[DataEntry]") + 1
Me.[EnteredBy] = Environ("UserName")
Me.[EntryDate] = date
End Sub
Extra Info:
The form is bound to a query that uses the table with the field [EntryDate]. The field is data type Date/Time.