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 - 12 Sep 2007 18:46 GMT
Hello,

I'm trying to create a command button that by default will lock 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.

Any help would be much appreciated.

Thanks in advance,
Ruth.
Dale Fye - 12 Sep 2007 19:30 GMT
Ruthie,

The form has an AllowEdits property.  Set this to False in design view

Then, the code behind the cmd_Edit_Lock button can look like:

Private sub cmd_Edit_Lock_Click

   if me.cmd_Edit_Lock.Caption = "&Edit" then
       me.cmd_Edit_Lock.Caption = "&Lock"
       me.AllowEdits = True
   else
       me.cmd_Edit_Lock.Caption = "&Edit"
       me.AllowEdits = False
   end if

end sub

HTH
Dale

Signature

Email address is not valid.
Please reply to newsgroup only.

> Hello,
>
[quoted text clipped - 7 lines]
> Thanks in advance,
> Ruth.
Pieter Wijnen - 12 Sep 2007 20:09 GMT
Note that this will lock all controls (even unbound ComboBoxes)

Pieter

> Ruthie,
>
[quoted text clipped - 31 lines]
>> Thanks in advance,
>> Ruth.
 
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



©2009 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.