I've been coding and maybe I'm tired or what.. But I can't figure out that why is the error "please fill in all fields" is displayed even though all the textboxes are filled..
Secondly, what do you do after you're done making a program? I made the project.exe thing.. But how will i ensure that users always have the database and related files in the same folder? cuz my ADO connections won't work then...
Code:
Private Sub Command2_Click()
confirm2 = MsgBox("Are you sure you want to update data?", vbYesNo + vbQuestion, "Confirmation")
If confirm2 = vbYes Then
If Len(txtCustomer.Text) And Len(txtName.Text) And Len(txtAddress.Text) And Len(txtcontact.Text) > 0 Then
Adodc1.Recordset.Fields("Customer_ID").Value = txtCustomer.Text
Adodc1.Recordset.Fields("Customer_Name").Value = txtName.Text
Adodc1.Recordset.Fields("Address").Value = txtAddress.Text
Adodc1.Recordset.Fields("Contact_number").Value = txtcontact.Text
Adodc1.Recordset.Fields("Loyalty_Card").Value = Combo1.Text
Adodc1.Recordset.Update
Adodc1.Refresh
Print MsgBox("Record(s) updated!", vbOKOnly + vbInformation, "Updation successful!")
Else
Print MsgBox("Please fill in all fields", vbOKOnly + vbExclamation, "Values not filled!")
End If
Else
Print MsgBox("Records were not updated", vbOKOnly + vbExclamation, "Unsuccessful")
End If
End Sub