K
KJ
I was trying to execute an append query that gets input
parameters from a form using a macro but I think what Help
just told me is that I need to use the DoCmd method of
RUNSQL. I am very new to VBA so how would I convert the
following SQL code to VBA?
INSERT INTO tblAppend ( CustomerID, EmployeeID, OrderID,
OrderDate )
SELECT Orders.CustomerID, Orders.EmployeeID,
Orders.OrderID, Orders.OrderDate
FROM Orders
WHERE (((Orders.CustomerID)=[Forms]![frmAppendwSubform]!
[frmAppendTest]![WhatCustomer]) AND ((Orders.EmployeeID)=
[Forms]![frmAppendwSubform]![frmAppendTest]![WhatEmployee].
[form]))
ORDER BY Orders.CustomerID, Orders.EmployeeID;
Thanks in advance for any help you can provide.
parameters from a form using a macro but I think what Help
just told me is that I need to use the DoCmd method of
RUNSQL. I am very new to VBA so how would I convert the
following SQL code to VBA?
INSERT INTO tblAppend ( CustomerID, EmployeeID, OrderID,
OrderDate )
SELECT Orders.CustomerID, Orders.EmployeeID,
Orders.OrderID, Orders.OrderDate
FROM Orders
WHERE (((Orders.CustomerID)=[Forms]![frmAppendwSubform]!
[frmAppendTest]![WhatCustomer]) AND ((Orders.EmployeeID)=
[Forms]![frmAppendwSubform]![frmAppendTest]![WhatEmployee].
[form]))
ORDER BY Orders.CustomerID, Orders.EmployeeID;
Thanks in advance for any help you can provide.