SQL UPDATE Problem

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

This statement is not Updating...

Dim UPSQL As String
DoCmd.SetWarnings False
UPSQL = "UPDATE Customers SET Customers.BusinessName = '" &
Forms!AddCustomer!TxtBusinessName & "' " & _
"AND Customers.FName = '" & Forms!AddCustomer!TxtFName & "' " & _
"AND Customers.LName = '" & Forms!AddCustomer!TxtLName & "' " & _
"WHERE Customers.CustomerID = " & Forms!AddCustomer!TxtCustomerID & ";"
DoCmd.RunSQL (UPSQL)
DoCmd.SetWarnings True

BusinessName ends up being -1
FName and LName are ignored completely.
All fields are text.

Any help appreciated!
Thanks
DS
 
DS said:
This statement is not Updating...

Dim UPSQL As String
DoCmd.SetWarnings False
UPSQL = "UPDATE Customers SET Customers.BusinessName = '" &
Forms!AddCustomer!TxtBusinessName & "' " & _
"AND Customers.FName = '" & Forms!AddCustomer!TxtFName & "' " & _
"AND Customers.LName = '" & Forms!AddCustomer!TxtLName & "' " & _
"WHERE Customers.CustomerID = " & Forms!AddCustomer!TxtCustomerID & ";"
DoCmd.RunSQL (UPSQL)
DoCmd.SetWarnings True

BusinessName ends up being -1
FName and LName are ignored completely.
All fields are text.

Any help appreciated!
Thanks
DS
Problem Solved.
I took the ANDS out.
Thanks
DS
 
Back
Top