Database Name: db1
Table Name: Table1
VISUAL BASIC
Form Name: frmmain
Code:
Private Sub cmdadd_Click() frmadd.Show End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub cmdupdate_Click() frmupdate.Show End Sub
Private Sub cmdviewdelete_Click() frmviewdelete.Show End Sub
Form Name: frmadd
Code:
Option Explicit
Dim rs As New ADODB.Recordset
Dim db As New ADODB.Connection
Private Sub cmdadd_Click()
If Me.txtlastname.Text = "" Then
MsgBox "please input your last name"
Me.txtlastname.SetFocus
Exit Sub
ElseIf Me.txtfirstname.Text = "" Then
MsgBox "please input your first name"
Me.txtfirstname.SetFocus
Exit Sub
ElseIf Me.txtmiddlename.Text = "" Then
MsgBox "please input your middle name"
Me.txtmiddlename.SetFocus
Exit Sub
ElseIf Me.txtstreet.Text = "" Then
MsgBox "please input the street"
Me.txtstreet.SetFocus
Exit Sub
ElseIf Me.txtbarangay.Text = "" Then
MsgBox "please input barangay"
Me.txtbarangay.SetFocus
Exit Sub
ElseIf Me.txtmunicipality.Text = "" Then
MsgBox "please input municipality"
Me.txtmunicipality.SetFocus
Exit Sub
ElseIf Me.txtprovince.Text = "" Then
MsgBox "please input province"
Me.txtprovince.SetFocus
Exit Sub
ElseIf Me.txtcontactno.Text = "" Then
MsgBox "please input your contact number"
Me.txtcontactno.SetFocus
Exit Sub
ElseIf Me.cbobmonth.Text = "" Then
MsgBox "please input the month of your bday"
Me.cbobmonth.SetFocus
Exit Sub
ElseIf Me.cbobday.Text = "" Then
MsgBox "please input the day of your bday"
Me.cbobday.SetFocus
Exit Sub
ElseIf Me.cbobyear.Text = "" Then
MsgBox "please input the year of your bday"
Me.cbobyear.SetFocus
Exit Sub
ElseIf Me.cbocourse.Text = "" Then
MsgBox "please input your course"
Me.cbocourse.SetFocus
Exit Sub
ElseIf Me.cboyear.Text = "" Then
MsgBox "please input your year"