Solved InputBox with Asterix

mike60smart

Registered User.
Local time
Today, 17:31
Joined
Aug 6, 2017
Messages
1,994
Hi Everyone
I am trying to use the Code shown in the following previous thread

When I run the Code I get the error shown Below.

Code:
Private Sub cmdAdmin_Click()

On Error Resume Next
    Dim pWord As String
    pWord = InputBoxDK("Enter Administrative Password", "Password Required!")
    If pWord = "" Then
        MsgBox "Nothing Entered" & vbCrLf & vbLf & "Please Contact Your Local Administrator", vbCritical, "Security Logging"
        GoTo ExitInput:
    End If
    If pWord = SCtb0825 Then 'password is correct (password of your choice)
        DoCmd.OpenForm "Administration"
    Else
       MsgBox "Incorrect Password!" & vbCrLf & vbLf & "Please Contact Your Local Administrator", vbCritical, "Security Logging"
       Exit Sub
    End If
ExitInput:
End Sub

Can anyone tell me where I am going wrong with this?
Any help appreciated.
 

Attachments

  • Error.PNG
    Error.PNG
    33.3 KB · Views: 109
See my article:
 
Hi Everyone
I am trying to use the Code shown in the following previous thread

When I run the Code I get the error shown Below.

Code:
Private Sub cmdAdmin_Click()

On Error Resume Next
    Dim pWord As String
    pWord = InputBoxDK("Enter Administrative Password", "Password Required!")
    If pWord = "" Then
        MsgBox "Nothing Entered" & vbCrLf & vbLf & "Please Contact Your Local Administrator", vbCritical, "Security Logging"
        GoTo ExitInput:
    End If
    If pWord = SCtb0825 Then 'password is correct (password of your choice)
        DoCmd.OpenForm "Administration"
    Else
       MsgBox "Incorrect Password!" & vbCrLf & vbLf & "Please Contact Your Local Administrator", vbCritical, "Security Logging"
       Exit Sub
    End If
ExitInput:
End Sub

Can anyone tell me where I am going wrong with this?
Any help appreciated.
Pretty simple really, password does not match sc whatever as you have not have declared it or made available to that function/sub.

Whose db is this you are working on?
 
Never mind, the actual owner of the db has replied elsewhere. :)


 
Hi Gasman

Yes that example provided by Isladogs works fine
 
I had a customer who moaned on and on about having to enter a password to open the program and how he couldn't see the characters he typed in. He was such a pain every time I went, or when we spoke on the phone and wouldn't pay to have our updated password entry with switch added to see what he'd typed. Because of his attitude and on general principles I wouldn't update him for free. In the end I told him to change his password to eight asterisks. He could still be using that same password.


(P.S. Asterix is a fat little cartoon character in stripy trousers)
 
Last edited:
(P.S. Asterix is a fat little cartoon character in stripy trousers)
Asterix was indeed a little cartoon character, but it was Obelix who was the fat one with the stripy trousers. :-) #justsaying
 

Users who are viewing this thread

Back
Top Bottom