I am trying to utilize some code that John provided me previously to create some records into a transaction table from a pair of related template tables. HIs code works fine; mine doesn't (go figure, right?)
I put some debug.print statements into the code and the module works fine until it reaches the db.Execute strSQL statement, at which time it throws the error message "UNEXPECTED ERROR:3061; TOO FEW PARAMETERS, EXPECTED 1. I can only guess it has something to do with My SQL statement but I cannot figure out what it is. It is (at least to me) exactly as John's code which works. I have just exchanged table names and field names. BTW, all field names are ID fields and are long integers.
strSQL = "INSERT INTO tblInventoryDetails (InventoryHeaderID, StorageTankID, ProductID) " & _
"SELECT " & Me.InventoryHeaderID & ", StorageTankID, ProductID " & _
"FROM tblInventoryHeaderTemplates " & _
"INNER JOIN tblInventoryDetailTemplates " & _
"ON tblInventoryHeaderTemplates.InventoryHeaderTemplateID = tblInventoryDetailTemplates.InventoryHeaderTemplateID " & _
"WHERE tblInventoryHeaderTemplates.InventoryHeaderTemplateID = " & Me.InventoryHeaderTemplateID & ";"
"SELECT " & Me.InventoryHeaderID & ", StorageTankID, ProductID " & _
"FROM tblInventoryHeaderTemplates " & _
"INNER JOIN tblInventoryDetailTemplates " & _
"ON tblInventoryHeaderTemplates.InventoryHeaderTemplateID = tblInventoryDetailTemplates.InventoryHeaderTemplateID " & _
"WHERE tblInventoryHeaderTemplates.InventoryHeaderTemplateID = " & Me.InventoryHeaderTemplateID & ";"
db.Execute strSQL, dbFailOnError
__._,_.___
Posted by: david.pratt@outlook.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar