macro for previous record

E

erdiv

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?
 
S

Steve Schapel

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top