Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update query problem

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I have the following vba update query:

strSQLB = "UPDATE Exch_Designation_List SET Broker_Number = " & cboBrokerNumber & " , Firm = '" & sFirm & "' ,Office = '" & txtOffice & "' , Sales_Series = 'XXXXX', Account_Number = 'XXXXX';"
MsgBox strSQLB
DoCmd.RunSQL strSQLB

The query is not updating the table. Can anyone qive me some suggestions on what might be going wrong? Thanks.

dave
 
Since your SQL doesn't have any constraints defined (i.e. there's no WHERE clause,) this will attempt to update every record in the table.

If one of the fields is (or is part of) the primary key then attempting to change it to a constant value will cause duplicate key problems. Also, if the fields in this table are foreign keys into another table then you may be raising foreign key violations if that value doesn't exist in the other table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top