Re: Lock a form: Locked property of subform
- From: Crystal <strive4peace2006@xxxxxxxxx>
- Date: Tue, 21 Feb 2006 14:59:21 -0500
Hi Andre,
There is also a Locked property of the subform control (that has SourceObject, LinkMasterFields, LinkChildFields, etc)
Have an awesome day
Warm Regards,
Crystal
MVP Microsoft Access
strive4peace2006 at yahoo.com
Andre Thompson wrote:
Hi Allen.
How do I unlock the subform(s)?
"Allen Browne" wrote:
Open your form in design view, and set these properties:
Allow Edits No
Allow Additions No
Allow Deletions No
Add a command button, and give it these properties:
Name cmdLock
Caption Un&Lock
On Click [Event Procedure]
Click the Build button (...) beside the On Click property.
Access opens the code window.
Paste in the code below.
Private Sub cmdLock_Click()
Dim bAllow As Boolean
bAllow = Not Me.AllowEdits
Me.AllowEdits = bAllow
Me.AllowAdditions = bAllow
Me.AllowDeletions = bAllow
Me.cmdLock.Caption = IIf(bAllow, "&Lock", "Un&Lock")
End Sub
Note that even unbound controls are locked with this code, and so are subforms. If that is undesirable, you can set the Locked property of each control on the form instead.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"emmy128" <emmy128@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C53A16C1-7236-456D-AF10-2F90EC4B269A@xxxxxxxxxxxxxxxx
Im wondering if there is a way to lock the information shown on a form. The
information that shows on my form is from a table, and i want to make it so
that the user cannot edit the names unless they hit the edit button.
so, in essence, i want to make the information un-editable, and, i want to
create a command button that unlocks the info for editing purposes.
because, by default, the information shows up in my combo boxes and text
boxes, if the user doesnt choose to "add a new record" he/she will type over
the existing info....
is this confusing?? if not, please help!!
Cheers
- Prev by Date: Re: Rename form ?
- Next by Date: RE: Cannot get code to work for API Save Dialog Box
- Previous by thread: Re: How do I change the cursor starting position?
- Next by thread: Preview reports at 100%
- Index(es):