checkbox password

jonnywakey

Registered User.
Local time
Today, 10:25
Joined
Feb 2, 2009
Messages
33
Hi

I have a checkbox [e1]on a form which I want users to be able to tick; however once ticked I would like the tickbox to be locked.

To un-check the checkbox I would like a msgbox to appear asking for a password, once correct password entered the tickbox is unticked.

Example: an on click event

If Me.e1.Value = True Then
If InputBox("You must provide the correct password to unlock tickbox!", "Password Input") <> "NPI" Then
Me.e1.Locked = True
Else
MsgBox "Wrong Password Entered. Operation aborted!", vbCritical, Cancel = True
End If
End If


Any help much appreciated.

Jonny:(
 
Hi

I have a checkbox [e1]on a form which I want users to be able to tick; however once ticked I would like the tickbox to be locked.

To un-check the checkbox I would like a msgbox to appear asking for a password, once correct password entered the tickbox is unticked.

Example: an on click event

If Me.e1.Value = True Then
If InputBox("You must provide the correct password to unlock tickbox!", "Password Input") <> "NPI" Then
Me.e1.Locked = True
Else
MsgBox "Wrong Password Entered. Operation aborted!", vbCritical, Cancel = True
End If
End If


Any help much appreciated.

Jonny:(

I hate using checkboxed in this manner. Why not use a button to unlock the checkbox?

Code:
Private Sub Check0_AfterUpdate()
If Me.Check0 = -1 Then
Me.Check0.Locked = True
End If
End Sub

Code:
Private Sub Command1_Click()
Dim strPassword As String

strPassword = InputBox("Enter password", "Password")
If Len(strPassword) > 0 Then
    If strPassword = "NPI" Then
        Me.Check0.Locked = False
    Else
        MsgBox "you entered an incorect passowrd!"
    End If
Else
MsgBox "you must enter a password", vbExclamation
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom