Command Button

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.
 
R

ruralguy via AccessMonster.com

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
 
F

fredg

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
 

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

Similar Threads

Command Button 2
Record Lock 6
Update queries with form (trying to avoid error) 1
Locking Fields 3
Edit Record Command 2
Edit Records 2
command button 2
Change suborm to Data Entry 8

Top