Question Where Did I Go Wrong?

Ajwc

New member
Local time
Today, 03:47
Joined
Apr 4, 2013
Messages
6
I keep getting this message when I click my button
popup.png

Option Compare Database
Private Sub Command37_Click()

Dim Password As String

Password = InputBox("What is the password?")

If Password = "hi" Then
Me.ID.Locked = False
Me.Addiction.Locked = False
Me.Age.Locked = False
Me.HoursOnlinePerWK.Locked = False
Me.DaysOnlinePerWK.Locked = False
Me.Recovered.Locked = False
Me.Timezone.Locked = False
Me.Country.Locked = False
Me.URL.Locked = False
MsgBox ("You may now make changes")
Else
On Error GoTo Err_Command37_Click
Retry:
Dim strInput As String
strInput = InputBox("Please Enter the Password", "Enter Password")
If strInput = "hi" Then
DoCmd.OpenForm "Time2RecoverInfomation", acNormal
Else
If MsgBox("You entered the wrong password. Do you wish to try again?", vbQuestion + vbYesNo, "Password Error") = vbYes Then
GoTo Retry:
End If
End If
Exit_Time2RecoverInfomation_Click:
Exit Sub
Err_Time2RecoverInfomation_Click:
MsgBox Err.Description
Resume Exit_Time2RecoverInfomation_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Time2RecoverInfomation"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click

End Sub


Private Sub Command38_Click()
Me.ID.Locked = True
Me.Addiction.Locked = True
Me.Age.Locked = True
Me.HoursOnlinePerWK.Locked = True
Me.DaysOnlinePerWK.Locked = True
Me.Recovered.Locked = True
Me.Timezone.Locked = True
Me.Country.Locked = True
Me.URL.Locked = True
MsgBox ("Data locked")
End Sub
 
In the VBA editor, under debug, click Compile.

It should show you the offending line.

You have and IF statement without and Ending "End If".

I see 3 IF statements and 2 End If.

Dale
 

Users who are viewing this thread

Back
Top Bottom