Ok this ones got me stumped.
I have a list of all Suppliers needing to be set up.
Next to each supplier is a command button which is meant to take the specific record and append it to a new table.
The VBA code for the command button is as follows:
Private Sub SelectSupplier_Click()
Dim strSQL As String
Dim UseIDCode As String
UseIDCode = Form_frmSetUpSupplierFromPO.txtPOIDCode.Value
strSQL = "INSERT INTO [tblSupplierData] ([Supplier], [Address1]) SELECT [tblPurchaseOrderRequistion].[SupplierName], [tblPurchaseOrderRequistion].[SupplierAddress1]FROM [tblPurchaseOrderRequistion]WHERE (([tblPurchaseOrderRequistion].[IDCode]) = UseIDCode);"
CurrentDb.Execute strSQL
End Sub
And the error I get is "Run-time error '3061' - Too few parameters. Expected 1.
This has been puzzling me for a while - I know the problem is in my SQL statement but I can't see it!
Many thanks,
Rich
I have a list of all Suppliers needing to be set up.
Next to each supplier is a command button which is meant to take the specific record and append it to a new table.
The VBA code for the command button is as follows:
Private Sub SelectSupplier_Click()
Dim strSQL As String
Dim UseIDCode As String
UseIDCode = Form_frmSetUpSupplierFromPO.txtPOIDCode.Value
strSQL = "INSERT INTO [tblSupplierData] ([Supplier], [Address1]) SELECT [tblPurchaseOrderRequistion].[SupplierName], [tblPurchaseOrderRequistion].[SupplierAddress1]FROM [tblPurchaseOrderRequistion]WHERE (([tblPurchaseOrderRequistion].[IDCode]) = UseIDCode);"
CurrentDb.Execute strSQL
End Sub
And the error I get is "Run-time error '3061' - Too few parameters. Expected 1.
This has been puzzling me for a while - I know the problem is in my SQL statement but I can't see it!
Many thanks,
Rich