Carrying Date field info to next record.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For easy input. I need code that will carry the date field info to the next
record added.
 
For easy input. I need code that will carry the date field info to the next
record added.

Code the Control's AfterUpdate event:
Me![DateControl].DefaultValue = "#" & Me![DateControl] & "#"

The entered date will be the default value for new records during this
session until you over-ride it with a new date, or close the form or
database.
 
iholder said:
For easy input. I need code that will carry the date field info to the next
record added.


To make all subsequent new records default to last entered
value in a text box, set the text box's DefaultValue
property in the text box's AfterUpdate event:

For a DateTime field:
Me.textbox.DefaultValue = _
Format(Me.textbox, "\#m\/d\/yyyy\#")

For a numeric type field:
Me.textbox.DefaultValue = Me.textbox

For a Text field:
Me.textbox.DefaultValue = """" & Me.textbox & """"
 
Thank you both for the code. It works perfect.
I will hold on to both codes for future reference.
 
Back
Top