Forms editing

  • Thread starter Thread starter Sandra Grawunder
  • Start date Start date
S

Sandra Grawunder

How is the best way to prevent "mis-edits" in a form?
For some reason some of my users will forget the "Find"
button and start typing in the fields. This of course
changes the record. Presently I have the form open with
Allow Edits "No" which provides security for the record,
but when we need to change the information I would like a
Command button for "Edit" at the top but I don't know how
to code this so that the form can now be edited.

TIA,

Sandra
 
Command button's Click event procedure:

Private cmdLock_Click()
Dim bAllow As Boolean

If Me.Dirty Then 'Save first.
Me.Dirty = False
End If

bAllow = Not Me.AllowEdits
Me.AllowEdits = bAllow
Me.AllowDeletions = bAllow
Me.AllowAdditions = bAllow
Me.cmdLock.Caption = IIf(bAllow, "&Lock", "Un&lock")
Me.rctShowLock.Visible = Not bAllow
End Sub

The idea of the rectangle is to act as a red border around the edge of the
form when it is locked, as a visual cue for the user.
 
Allen- Thank you so much
-----Original Message-----
Command button's Click event procedure:

Private cmdLock_Click()
Dim bAllow As Boolean

If Me.Dirty Then 'Save first.
Me.Dirty = False
End If

bAllow = Not Me.AllowEdits
Me.AllowEdits = bAllow
Me.AllowDeletions = bAllow
Me.AllowAdditions = bAllow
Me.cmdLock.Caption = IIf(bAllow, "&Lock", "Un&lock")
Me.rctShowLock.Visible = Not bAllow
End Sub

The idea of the rectangle is to act as a red border around the edge of the
form when it is locked, as a visual cue for the user.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top