Macro

  • Thread starter Thread starter LG
  • Start date Start date
L

LG

What would be the macro or how would i go about the following. The processor
enters a value in a form. I would like that value to stay the same until it
is changed. What code or macro would i need to put on that field.
 
What would be the macro or how would i go about the following. The processor
enters a value in a form. I would like that value to stay the same until it
is changed. What code or macro would i need to put on that field.

No code and no macro needed; just store the value in a table (by binding the
form to a table).

If that's not what you meant please explain.
 
What I mean is they enter a number or code in a field but it changes everyday
and everytime a different processors enters the form. I am wanting the field
to stay the same (what they type in there) until they physically change it.
I don't want them to have to retype that field everytime they tab only if it
changes.
 
What I mean is they enter a number or code in a field but it changes everyday
and everytime a different processors enters the form. I am wanting the field
to stay the same (what they type in there) until they physically change it.
I don't want them to have to retype that field everytime they tab only if it
changes.

Ah. Ok, you can set its DefaultValue property in the AfterUpdate event of the
textbox. Open the form in design view; find this control and view its
Properties. Click the ... icon by the After Update event on the Events tab and
choose "Code Builder". Edit the code to:

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

replacing controlname by the actual name of the control. This will make the
entered value "sticky"; it can be manually changed but will repeat until
that's done.
 
Back
Top