Something like this, I think.
VB Code:
Option Explicit
' in Form2
Private Sub cmdLogin_Click()
user = Text1.Text
pass = Text2.Text
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc(vbTab) Then
Text2.SetFocus
End If
End Sub
and
VB Code:
Option Explicit
' in module1.bas
' make sure you go to project properties and set startup to sub Main
Public user$, pass$
Sub Main()
Form2.Show vbModal
If user = "user" And pass = "pass" Then
Form1.Show
Else
MsgBox "Incorrect Login"
End If
End Sub
form1 will get called only if the user supplies the correct information.