Macro to

B

Banda

i would like to run a macro that will deny user to change data once entered
in Ms Access form field. what must i put in macro, your help will be greatly
appreciated,
 
K

Ken Snell \(MVP\)

At what point should the data be "locked"? Right after the user has entered
the data and is still in the control? After the user leaves the control?
After the user has saved the record in which the data were entered?
 
B

Banda

i would like to run a macro that will deny user to change data once entered
in Ms Access form field. what must i put in macro, your help will be greatly
appreciated,
I would like the data in that field to be locked once record is saved,
Thanks
 
K

Ken Snell \(MVP\)

Use the form's Current event to test the NewRecord property, and set the
Locked property for the control accordingly:

Private Sub Form_Current()
Me.NameOfControl.Locked = Not Me.NewRecord
End Sub
 
K

Ken Snell \(MVP\)

Or, using an ACCESS macro that is attached to the form's OnCurrent property:

Action: SetValue
Item: NameOfControl.Locked
Expression: Not [NewRecord]
 

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