Command Button

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

Guest

Hello,

I'm trying to create a command button that by default will lock all records
in the form, and will only allow edits after it is clicked, to avoid
unnecessary mistakes. In other words all records are locked until the user
clicks command button to edit each record individually. I would like it so
that you have to click the unlock button for each record you wish to edit. So
that if I unlock one record, then go on to the next record, it too is locked.
And the previous one locks itself again.

Any help would be much appreciated.

Thanks in advance,
Ruth.
 
You can put the following in the Click event of the Command button:
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = True

...and in the Current Event of the form put:
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
 
Hello,

I'm trying to create a command button that by default will lock all records
in the form, and will only allow edits after it is clicked, to avoid
unnecessary mistakes. In other words all records are locked until the user
clicks command button to edit each record individually. I would like it so
that you have to click the unlock button for each record you wish to edit. So
that if I unlock one record, then go on to the next record, it too is locked.
And the previous one locks itself again.

Any help would be much appreciated.

Thanks in advance,
Ruth.

What about deleting or adding a new record?

Code the Form's Current event:
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False

Code the Command button Click event:
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
 
Back
Top