Koneksi VB dengan Access

Private Sub Command1_Click()
Dim snpm As String
snpm = InputBox(“npm:”)
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find “npm =” & snpm & “”
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Adodc1.Recordset.AddNew
End Sub

Private Sub Command3_Click()
Adodc1.Recordset.Update
MsgBox “data berhasil disimpan…!!!”, vbOKOnly + vbInformation, “konfirmasi”
End Sub

Private Sub Command4_Click()
If MsgBox(“apakah anda yakin ingin menghapusnya…???”, vbOKCancel + vbCritical, “konfirmasi”) = vbOK Then
Adodc1.Recordset.Delete

End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Form_Activate()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s