Wednesday, April 25, 2012

VB6 Programming





Now we will discuss a bit about visual basic programming, To the knowledge it gains do not quickly disappear from our memory space.


Button Simpan


Private Sub cmdSimpan_Click()
Set rs = New Recordset
rs.Open "dosen", db, adOpenStatic, adLockOptimistic
rs.AddNew
rs.Fields("nip") = txtNIP.Text
rs.Fields("nama") = txtNama.Text
rs.Fields("tempat_lahir") = txtTempatLahir.Text
rs.Fields("tanggal_lahir") = dTglLahir.Value
rs.Fields("lulusan") = txtLulusan.Text
rs.Fields("jabatan") = txtJabatan.Text
If Option1.Value = True Then
    rs.Fields("jekel") = "Laki-laki"
ElseIf Option2.Value = True Then
    rs.Fields("jekel") = "Perempuan"
End If
rs.Update
MsgBox "Data Sudah Disimpan", vbOKOnly, "Info"
Set rs = Nothing
End Sub

Button Keluar


Private Sub cmdKeluar_Click()
Unload Me
End Sub