Kamis, 30 Agustus 2012

Form Login (Tampilkan Foto)


Private Sub txtkodeuser_Change()
If adouser.Recordset.RecordCount = 0 Then Exit Sub
If txtkodeuser.Text <> "" Then
    adouser.Recordset.MoveFirst
    adouser.Recordset.Find "[kodeuser]= '" & txtkodeuser.Text & "'"
    If Not (adouser.Recordset.EOF Or adouser.Recordset.BOF) Then
        txtnamauser.Text = adouser.Recordset!namauser
        txtjabatan.Text = adouser.Recordset!jabatan
        var_password = adouser.Recordset!Password
    End If
Else
        txtnamauser.Text = ""
        txtjabatan.Text = ""
        var_password = ""
        Imgfoto.Picture = Nothing
End If
End Sub

TAMPILKAN DATA DAN FOTO

Private Sub txtpassword_GotFocus()
If adouser.Recordset.RecordCount = 0 Then Exit Sub
adouser.Recordset.MoveFirst
adouser.Recordset.Find "[kodeuser]= '" & txtkodeuser.Text & "'"
If Not adouser.Recordset.EOF Then
                On Error GoTo pesan
                If Not IsNull(adouser.Recordset!foto) Then
                Imgfoto.Picture = LoadPicture(adouser.Recordset!foto)
                End If
                Exit Sub
pesan: MsgBox ("Maaf, path anda salah Jadi fotonya tidak tampil")
Imgfoto.Picture = Nothing
       
        Exit Sub
End If


Tidak ada komentar:

Posting Komentar

hay friend... sebelum exit, jgn lupa tinggalkan comment dulu ya...
kalau mau bertanya bisa tulis komentar atau email/fb ke: aranama@ymail.com
thank you...