Listing Program

 Private Sub cmdbatal_Click()
Me.txtname.Text = ""
Me.txtpass.Text = ""
Me.txtname.SetFocus
End Sub

Private Sub cmdlogin_Click()
If Me.txtname.Text = "ADMIN" And Me.txtpass.Text = "ADMIN" Then
pesan = MsgBox("Selamat Anda Berhasil Login", vbOKOnly, "Selamat")
Unload Me
Else
pesan = MsgBox("Username & Password salah", vbInformation, "ERROR")
End If
End Sub

Private Sub txtname_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Me.txtpass.SetFocus
End If
End Sub

Private Sub txtpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Me.cmdlogin.SetFocus
End If
End Sub