A
Alp Bekisoglu
Hi Experts,
Might be a very obvious reason but just couldn't figure out why this is not
working. It works when I run the query but refuses to run in VBA.
SQL of the query:
SELECT Sum(tb_bookings.Dom) AS SumOfDom, [Events]![dom_bts]-[SumOfDom] AS
Remaining, Events.dom_bts
FROM Events, tb_bookings
GROUP BY Events.dom_bts;
The code in VBA:
Dim strSQL As String
strSQL = "SELECT Sum(tb_bookings.Dom) AS SumOfDom, (Events.dom_bts-SumOfDom)
AS Remaining, Events.dom_bts" & _
" FROM Events, tb_bookings GROUP BY Events.dom_bts;"
DoCmd.RunSQL strSQL
Error is:
Run-time error '2342'
A RunSQL action requires an argument consisting of an SQL statement.
Thanks in advance,
Alp
Might be a very obvious reason but just couldn't figure out why this is not
working. It works when I run the query but refuses to run in VBA.
SQL of the query:
SELECT Sum(tb_bookings.Dom) AS SumOfDom, [Events]![dom_bts]-[SumOfDom] AS
Remaining, Events.dom_bts
FROM Events, tb_bookings
GROUP BY Events.dom_bts;
The code in VBA:
Dim strSQL As String
strSQL = "SELECT Sum(tb_bookings.Dom) AS SumOfDom, (Events.dom_bts-SumOfDom)
AS Remaining, Events.dom_bts" & _
" FROM Events, tb_bookings GROUP BY Events.dom_bts;"
DoCmd.RunSQL strSQL
Error is:
Run-time error '2342'
A RunSQL action requires an argument consisting of an SQL statement.
Thanks in advance,
Alp