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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy one - Insert Problem

Status
Not open for further replies.

Pilly170

IS-IT--Management
Aug 28, 2003
36
0
0
US
Hi,

I have a sql table with the following fields.
ProdNo , Manufacturer , Manufacturer_ProdNo, System_Text1 , Category , Stock , Price

and an access table
Custno, ProdNo, Price , Branch

My function is this, it imports the SQL table into the access table.

Function Update_XML_Tables(Custno As String)

Dim XMLupdate As String

XMLupdate = "INSERT INTO XML_Upload_Pricelist ([CustNo], [ProdNo], [Price]) " & _
"Select '" & Custno & "' As CustNo, ProdNo, Price " & _
"From mysql_dealer_" & Custno& " "

DoCmd.RunSQL XMLupdate

End Function

What i want to do is enter a static value of 13 into the branch. I tried :

XMLupdate = "INSERT INTO XML_Upload_Pricelist ([CustNo], [ProdNo], [Price], [Branch]) " & _
"Select '" & Custno & "' As CustNo, ProdNo, Price, 13 " & _
"From mysql_dealer_" & Custno& " "

But that gave me an insert error. "unknown field branch"

Any ideas?? i bet its an easy one.
 
Perhaps this ?
XMLupdate = "INSERT INTO XML_Upload_Pricelist (CustNo, ProdNo, Price, Branch) " & _
"Select '" & Custno & "' As CustNo, ProdNo, Price, 13 As Branch " & _
"From mysql_dealer_" & Custno & ";"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

I tried but still the same error... Unknown field Branch
 
Forget that.... error was the export spec not recognising the BRanch .. THanks for your help
 
Double check the name of XML_Upload_Pricelist's fields ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top