SQL UPDATE Problem

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
 
D

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL Problem 2
SQL Not Updating 5
SQL Not Updating 2
SQL UPDATE Problem 5
SQL Date/Time Update 2
Function or Variable Expected 6
SQL Percent Problem 2
SQL UPDATE on the fly 5

Top