Hi, I'm new to Access so go easy on me!
I have a logon screen in an Access database as follows:

I already have the code for the "Login" button, which is:
Code:
Private Sub Command0_Click()
Dim dbs As DAO.Database
Dim rstUserPwd As Recordset
Dim bFondMatch As Boolean
Set dbs = CurrentDb
Set rstUserPwd = dbs.OpenRecordset("qryUserPwd")
bFoundMatch = False
If rstUserPwd.RecordCount > 0 Then
rstUserPwd.MoveFirst
' Check for matching records
Do While rstUserPwd.EOF = False
If rstUserPwd![UserName] = Form_frmLogon.txtUsername.Value And rstUserPwd![Password] = Form_frmLogon.txtPassword.Value Then
bFoundMatch = True
Exit Do
End If
rstUserPwd.MoveNext
Loop
End If
If bFoundMatch = True Then
'Open the next form here and close this one
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmSwitchboard2"
Else
'
MsgBox "Incorrect username or password!", vbCritical
End If
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
rstUserPwd.Close
End Sub
However, what I'm wanting to do is - based on the department that the user belongs to - redirect each different user to their own department. For example, jdoe might go to frmSwitchboard_Finance, whereas the database should redirect jsmith to frmSwitchboard_Management. How would I do this?