SCREENSHOT
CODE
Private Sub cmdDelete_Click()
On Error Resume Next
If MsgBox("Data is not recoverable!", vbInformation + vbOKCancel, "Confirm Delete") = vbOK Then
Adodc1.Recordset.Delete
Else
txtName.SetFocus
End If
End Sub
Private Sub cmdFirst_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub cmdLast_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub cmdNext_Click()
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MoveNext
End If
End Sub
Private Sub cmdPrevious_Click()
If Adodc1.Recordset.BOF = True Then
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.MovePrevious
End If
End Sub
Private Sub cmdSave_Click()
If txtName.Text = "" Or txtAge.Text = "" Or txtCourse.Text = "" Then
MsgBox "Empty Fields!", vbExclamation, "Input Error"
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset("Name") = txtName.Text
Adodc1.Recordset("Age") = txtAge.Text
Adodc1.Recordset("Course") = txtCourse.Text
Call clear
End If
End Sub
Sub clear()
txtName.Text = ""
txtAge.Text = ""
txtCourse.Text = ""
txtName.SetFocus
End Sub
CODE
Private Sub cmdDelete_Click()
On Error Resume Next
If MsgBox("Data is not recoverable!", vbInformation + vbOKCancel, "Confirm Delete") = vbOK Then
Adodc1.Recordset.Delete
Else
txtName.SetFocus
End If
End Sub
Private Sub cmdFirst_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub cmdLast_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub cmdNext_Click()
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MoveNext
End If
End Sub
Private Sub cmdPrevious_Click()
If Adodc1.Recordset.BOF = True Then
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.MovePrevious
End If
End Sub
Private Sub cmdSave_Click()
If txtName.Text = "" Or txtAge.Text = "" Or txtCourse.Text = "" Then
MsgBox "Empty Fields!", vbExclamation, "Input Error"
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset("Name") = txtName.Text
Adodc1.Recordset("Age") = txtAge.Text
Adodc1.Recordset("Course") = txtCourse.Text
Call clear
End If
End Sub
Sub clear()
txtName.Text = ""
txtAge.Text = ""
txtCourse.Text = ""
txtName.SetFocus
End Sub
Download Here: ADODC in VB 6.0 to MS Access with DataGrid Control
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :