Login form wont close

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello I have a login form that opens up my frm_Switchboard. The problem im
having is one the right password and userid gets entered I log in and the
form never closes. What and where do I enter the close command? Here is the
code behind my Login form. Thanks!!

Private Sub Command4_Click()
If IsNull(Me.quserid) Then
MsgBox "You must enter a User ID"
Exit Sub

Else

If IsNull(Me.qpwd) Then
MsgBox "You must enter a password"
Exit Sub

End If
End If


If Me.qpwd.Value = DLookup("PWD", "tbl_Password", "USERID = '" &
Me.quserid.Value & "'") Then

DoCmd.OpenForm "frm_Switchboard", acNormal

Else

MsgBox "Invalid User Name or Password"

End If

End Sub
 
You don't have anything that tells the form to close

Add
docmd.Close acForm,"Login form name"
after your open form command
 
Thanks a Million!

schasteen said:
You don't have anything that tells the form to close

Add
docmd.Close acForm,"Login form name"
after your open form command
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top