Persistent variable?

  • Thread starter Thread starter Mike from Moriches
  • Start date Start date
M

Mike from Moriches

?Greetings-
I enter many records with the same date. I prefer not to enter the date
over and over. My previous database had a "ditto" function that would
populate a field with the datum from the previous record, but allow me to
change it when I moved on to the next date. What is the best way to do this
in an Access 2007 form?
Thanks,
Mike from Moriches
 
One way is to set the DefaultValue of the control on your form. By doing so
in the control's AfterUpdate event, you get the ability to change the value
and have that change persist

Private Sub MyControl_AfterUpdate()

Me!MyControl.DefaultValue = Chr$(34) & Me!MyControl.Value & Chr$(34)

End Sub

(replace MyControl with your actual control name)
 
Back
Top