Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / September 2007

Tip: Looking for answers? Try searching our database.

Command Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ruthie - 17 Sep 2007 16:54 GMT
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.
ruralguy - 17 Sep 2007 19:03 GMT
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,
>
[quoted text clipped - 10 lines]
>Thanks in advance,
>Ruth.

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

fredg - 17 Sep 2007 19:05 GMT
> Hello,
>
[quoted text clipped - 10 lines]
> 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

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.