Dim dbnil As Database (not identifying the database name by the APP.Path)
Dim rscustomer As Recordset
Private Sub Command1_Click()
If Text1 = "" Then
MsgBox "please enter ID", vbCritical, "customer"
Text1.SetFocus
Else
If Text2 = "" Then
MsgBox "please enter the name", vbCritical, "customer"
Text2.SetFocus
Else
rscustomer.AddNew
customer(" ID") = Text1
customer("name") = Text2
customer.Update
MsgBox "Customer information accepted", vbInformation, "customer"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End If
End Sub
Private Sub Form_Load()
Set dbnil= OpenDatabase(App.Path & "\Customer.mdb")
Set rsCustomer = dbnil.OpenRecordset("Customertable")
MsgBox (test)
End Sub