I have an odd situtation where a section of code is resetting the status of either multi line If statments which then gives me the error " end if without block if" or something very similure, or select case where it's giving me " Case without Select case"
here is the offfending code.
it's curently giving the "Case without Select case" on the Case True line.
here is the offfending code.
Code:
Private Sub loginbutton_Click()
Dim rs As Recordset
Dim db As Database
Set db = CurrentDb
Dim searchstr As String
'If Not DLookup("Password", "Security", "Employee = " & SelID) = DigestStrToHexStr(Me.pass) Then
'Exit Sub
Select Case logasadmin
Case False
searchstr = "SELECT * FROM Security WHERE Employee = " & Chr(34) & Nz(Me![SelID], 0) & Chr(34)
Set rs = db.OpenRecordset(searchstr, dbOpenDynaset)
With rs
.Fields("Computerlogin") = Environ("username")
.Update
.Close
GBL_login = True
Case True
If Nz(DLookup("Password", "Security", "Employee = 666666")) = DigestStrToHexStr(Me.pass) Then
stDocName = "Adminwarning"
DoCmd.OpenForm stDocName, , , stLinkCriteria
GBL_login = True
End If
End Select
searchstr = "SELECT * FROM Security WHERE computerlogin = " & Chr(34) & Nz(Me![userid], 0) & Chr(34)
If DLookup("password", "Security", "Computerlogin = " & Environ("username")) = DigestStrToHexStr(Me.pass) Then
GBL_login = True
End If
DoCmd.Close
End Sub
Comment