Senin, 26 Maret 2012

Membuat Rumus Login,Logout, di Visual Basic




Private Sub Command1_Click()



If Text1 = "" Then

MsgBox ("user name tidak boleh kosong")
Text1.SetFocus
Exit Sub
End If

If Text2 = "" Then
MsgBox ("password tidak boleh di kosongkan")
Text2.SetFocus
Exit Sub
End If

rslogin.CommandType = adCmdText
rslogin.RecordSource = "select * from bagian where username='" & Text1 & " ' and Password =  '" & Text2 & "'"

rslogin.Refresh
If rslogin.Recordset.EOF Then
MsgBox ("username atau password ada kesalahan")
Text1 = Clear
Text2 = Clear
Text1.SetFocus
Else
MsgBox ("vertifikasi password benar")

Unload Me

FRMMENU.MDATA.Visible = True
FRMMENU.MTRANSAKSI.Visible = True
FRMMENU.MLAPORAN.Visible = True
End If

FRMMENU.Text5 = rslogin.Recordset.Fields(1)
FRMMENU.Text6 = rslogin.Recordset.Fields(2)

End Sub

Private Sub Command2_Click()
Frmlogin.Hide
End Sub

Private Sub Form_Load()
Text1 = Clear
Text2 = Clear
rslogin.Refresh
End Sub
Rumus LOGOUT


Private Sub MLOGOUT_Click()
MDATA.Visible = False
MTRANSAKSI.Visible = False
MLAPORAN.Visible = False
Load Me

FRMMENU.MLOGIN.Visible = True
FRMMENU.MLOGOUT.Visible = False


End Sub

2 komentar:

Rian mengatakan...

mbak tri ada contoh projectnya kah, share donk...kalau penjelasannya kaya gitu masih bingung ngikutinnya.

Alfred mengatakan...

Bisa Bagi File nya ga

Posting Komentar