Code:
Private Sub CmdLogon_Click()
Dim rsUser As DAO.Recordset
Dim strUser As String
Set db = CurrentDb
strUser = "select initial,group from TB_User where initial = '" & UCase(Me!UserInitial) & "' and password = '" & UCase(Me!Password) & "'"
'Debug.Print strUser
Set rsUser = db.OpenRecordSet(strUser)
'rsUser.MoveFirst
If rsUser.EOF Then
MsgBox ("Invalid user name or password, please try again!")
Else
U_initial = rsUser.Fields("initial")
U_Groups = rsUser.Fields("group")
DoCmd.OpenForm "Tracking", acNormal
rsUser.Close
Set rsUser = Nothing
DoCmd.Close acForm, "FrmLogin", acSaveNo
End If
'Debug.Print U_Initial
'Debug.Print U_Groups
End Sub
I think you need to dim the recordset as DAO. See the Red.