I have a database that I am working on just changing some design stuff from the one I have now. The old one runs fine and the new one ran fine until I copied this code over which is identical to the old one and all the tables are the same but the FE freezes every time I try to open it.
Code:
Private Sub cmdLogIn_Click()
If userName & password = Null Then
Exit Sub
ElseIf Not password = DLookup("password", "tlogin", "userID = " & txtID) Then
message = "Wrong password or Username Please write the correct info..!"
Exit Sub
ElseIf password = DLookup("password", "tlogin", "userID = " & txtID) Then
If IsNull(DLookup("startup", "tstartupForm", "startupID =1")) Then
DoCmd.Close
DoCmd.OpenForm "fsettings_plugin"
Else
DoCmd.SetWarnings False
DoCmd.RunSQL ("UPDATE tTemp Set userID =" & Me.txtID)
DoCmd.Close
Dim srt As String
srt = DLookup("startup", "tstartupForm", "startupID =1")
DoCmd.OpenForm (srt)
End If
End If
End Sub
Private Sub userName_AfterUpdate()
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("Select * from tlogin where userID =" & userName)
If rst!remember = True Then
txtID = rst!userID
Me.password = rst!password
message = ""
Else
txtID = rst!userID
message = ""
Me.password = ""
End If
End Sub