jadams0173
Technical User
- Feb 18, 2005
- 1,210
When I try to run the query below in VBA like this
Currentproject.Connection.Execute strSql
I get and error stating that one or more required paramaters are missing.
However if I use the DoCmd.RunSQL strSql method it seems to run fine. It will also run fine inside access. Any ideas?
Currentproject.Connection.Execute strSql
I get and error stating that one or more required paramaters are missing.
However if I use the DoCmd.RunSQL strSql method it seems to run fine. It will also run fine inside access. Any ideas?
Code:
INSERT INTO tblReleased ( MO_NUMBER, ITEM, ORDER_QTY, SCHED_DATE, MOTYPE, FEEDERTOTAL, WH_PICKS1, RELEASED, TotalPicks, TotalFeedersNeeded, [Date], [time], lines, PRIORITY, COMMENT )
SELECT Schedule_1.MO_NUMBER, Schedule_1.ITEM, Schedule_1.ORDER_QTY, Schedule_1.SCHED_DATE, Schedule_1.MOTYPE, Sum(Schedule_1.TotalFeeders) AS FEEDERTOTAL, Schedule_1.WH_PICKS1, Schedule_1.RELEASED, Int([forms]![frmmain]![txtPicksReleased]) AS TotalPicks, Int([forms]![frmmain]![txtReleasedFeeders]) AS TotalFeedersNeeded, Date() AS [Date], Time() AS [time], [Schedule_1]![PrimaryB] & ' / ' & [Schedule_1]![PrimaryT] AS lines, PRIORITY, COMMENT
FROM Schedule_1
GROUP BY Schedule_1.MO_NUMBER, Schedule_1.ITEM, Schedule_1.ORDER_QTY, Schedule_1.SCHED_DATE, Schedule_1.MOTYPE, Schedule_1.WH_PICKS1, Schedule_1.RELEASED, Date(), Time(), [Schedule_1]![PrimaryB] & ' / ' & [Schedule_1]![PrimaryT], PRIORITY, comment
HAVING (((Schedule_1.RELEASED)=-1))