autofill previous date

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I have numerous records to enter using the same date on a form. (it is not
the current date and it will change) I don't want to retype the same date for
each record. I am very new to access and have tried several suggestions but
they haven't worked. My field is called Date.
 
Gary,
The name of your field is probably the reason that the suggestions you tried
didn't work.
Date is a reserved word that has special meaning in Access and shouldn't be
used for a field name.
Rename it to something like OrderDate, AssessmentDate, CallDate or similar.
For a date field the default value is written like this:

Private Sub TxtTheDate_AfterUpdate()
If Not IsNull(Me.TxtTheDate) Then
Me.TxtTheDate.DefaultValue ="#" & Me.TxtTheDate & "#"
End If
End Sub

Replace TxtTheDate with the name of the textbox control for your date field.

Jeanette Cunningham
 
In the After Update event of the date control:

Me.MyDateControl.DefaultValue = Me.MyDateControl
 
Thank you, changing the name did it, this puts in the date in a new record in
the form but gets stuck and won't continue on to another record (the new
record button is greyed out too.
 
Never mind. I found my problem. Thank you so much for your time and expert
advice.
Take Care
 
Back
Top