macro for previous record

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

Guest

I want to autofill a text box in a form with the valye of the previous record.
when typing ctrl+' you get the value of the field of the previous record.
How can I automate this in a form?
How can I insert ctrl+' as a command in a macro?
 
Erdiv,

If you are using your form in Single view, then probably the easiest way
to do this with a macro would be, on the After Update event of the
control, using a SetValue macro action to set the Default Value property
of the control to the value of the control. Like this:
Action: SetValue
Item: [YourField].[DefaultValue]
Expression: [YourField]

However, this won't work in a Continuous view form. If this is the
case, you need two macros. One on the After Update event of the
control, using SetValue to set the form's Tag property to the value of
the control, and then another, on the Before Insert event of the form
itself, using SetValue to set the value of the control to the value of
the form's Tag. Make sense?
 
Back
Top