Read-Only vs Edit Data On Form Via Button

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

Guest

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

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

Back
Top