Access XP/2000

J

jm

I have created a data entry form which opens in Modify. I would prefer to
have the form open in read only mode, but then allow the user to switch
modes should the individual make a record change.

In addition, I would prefer the a dialog box open prior to changing record.
This is an option in the Tools Options section - however, it does not appear
to work.

Can you please advise ?
Thanks !
 
A

Allen Browne

Set the Allow Edits property of the form to No.
You probably want to set AllowDeletions to No as well.

Add a command button that toggles these properties when clicked:

Private Sub cmdLock_Click()
Dim bLock As Boolean
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
bLock = Not Me.AllowEdits
Me.AllowEdits = bLock
Me.AllowDeletions = bLock
Me.cmdLock.Caption = IIf(bLock, "Un&lock", "&Lock")
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

Top