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 / Forms / March 2007

Tip: Looking for answers? Try searching our database.

Read-Only vs Edit Data On Form Via Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paputxi - 22 Mar 2007 16:04 GMT
I have a form with many fields displayed.  I want the data to be initially
displayed as read-only.  If the user wants to make updates then (s)he has to
click an Edit button that would then allow all the fields to be updatable.  
Any suggestions on how to accomplish this?  Thanks in advance.
Douglas J. Steele - 22 Mar 2007 16:14 GMT
Initialize the form's AllowEdits, AllowDeletions and AllowAdditions
properties to False.

In the button's Click event, change those properties back.

You might consider using a toggle button, rather than a simple command
button. To allow edits when the button is depressed, and not when it's
raised, try something like:

Private Sub MyToggleButton_Click()

 Me.AllowAdditions = Me.MyToggleButton
 Me.AllowDeletions = Me.MyToggleButton
 Me.AllowEdits = Me.MyToggleButton

End Sub

In the form's Load event, use:

Private Sub Form_Load()

 Me.MyToggleButton = False
 Me.AllowAdditions = False
 Me.AllowDeletions = False
 Me.AllowEdits = False

End Sub

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have a form with many fields displayed.  I want the data to be initially
> displayed as read-only.  If the user wants to make updates then (s)he has
> to
> click an Edit button that would then allow all the fields to be updatable.
> Any suggestions on how to accomplish this?  Thanks in advance.
 
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.