button to change "Locked" property of field

G

Guest

I've been told that a certain important field is too easily changed. I'd
like to use a toggle button to set the "Locked" value of the field. If the
toggle is pressed in, then the field is unlocked. If the toggle is pressed
again to deselect it, the field is locked.

That question is a meaty one and with the answer to it, I'd be pretty happy.
But, here's the gravy question.

Once I have that button, after the field has been changed, I'd like to
unpress the toggle button so that, to change the field again, the toggle
button must explicitley be pressed in.
 
G

Guest

I did the following:

Private Sub Apprentice_Type_AfterUpdate()
[App Type Toggle].Value = False
App_Picture_Set
End Sub

Private Sub App_Type_Toggle_Click()
App_Picture_Set
End Sub

Private Sub App_Picture_Set()
If [App Type Toggle].Value = True Then
[Apprentice Type].Locked = False
[App Type Toggle].Picture = "F:\Access\redbutton.bmp"
ElseIf [App Type Toggle].Value = False Then
[Apprentice Type].Locked = True
[App Type Toggle].Picture = "F:\Access\bluebutton.bmp"
End If
End Sub
 
G

Guest

hi, you can achieve this by placing a toggle button on the form and on its
"on click" write the following procedure

if [toggle name] = -1 then
[field name].locked = false
else
[field name].locked = true
end if

hope this helps
 

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