Senin, 08 Juni 2015

listing form ganti password vb2 mi (oke)




Private Sub btutup_Click()
Unload Me
FRMMENU.Show
End Sub

Private Sub Form_Activate()
For Each k In Me.Controls
If TypeOf k Is TextBox Then
k.Enabled = False
End If
Next
tkduser = FRMMENU.STBAR.Panels(1).Text
tlama.Enabled = True
tlama.SetFocus
tlama.PasswordChar = "*"
tbaru.PasswordChar = "*"
tkonf.PasswordChar = "*"
End Sub

Private Sub tbaru_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
tkonf.Enabled = True
tkonf.SetFocus
End If
End Sub

Private Sub tkonf_KeyPress(KeyAscii As Integer)
Call koneksi
If KeyAscii = 13 Then
    If tkonf.Text <> tbaru.Text Then
    MsgBox "konfirmasi dari password baru berbeda"
    Else
    rsuser.Open "update user set password='" & tkonf.Text & "' where kodeuser='" & tkduser.Text & "'", KON
    MsgBox "password telah diupdate"
    Call Form_Activate
    tlama = ""
    tbaru = ""
    tkonf = ""
End If
End If
End Sub

Private Sub tlama_KeyPress(KeyAscii As Integer)
Call koneksi
If KeyAscii = 13 Then
rsuser.Open "select* from user where password='" & tlama.Text & "'", KON
    If rsuser.EOF Then
    MsgBox "password " + tlama.Text + " tidak ada"
    tlama.SetFocus
    Else
    tbaru.Enabled = True
    tbaru.SetFocus
End If
End If
End Sub

Tidak ada komentar:

Posting Komentar