duplicating some data from previous record on a form

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

Guest

I have a form that I would like to simplify. This form is created to allow
for data to be entered for inventory checks. There are two feilds that very
often repeat. The name of the store and the date of the report. Is there a
simple yet elegant way of facilitating this?
 
I have a form that I would like to simplify. This form is created to allow
for data to be entered for inventory checks. There are two feilds that very
often repeat. The name of the store and the date of the report. Is there a
simple yet elegant way of facilitating this?

Yep. Put just a single line of code into the AfterUpdate event of each control
that you want autoduplicated:

Private Sub controlname_AfterUpdate()
Me.controlname.DefaultValue = Chr(34) & Me.controlname & Chr(34)
End Sub

This will take whatever the user entered, surround it with " marks to make it
a string constant, and set the control's Default Value to that string.

John W. Vinson [MVP]
 
Back
Top