Can someone help me and tell me what is wrong with this code?:
dbs.Execute " INSERT INTO Pagar ( Factura, Bodega, item, Cantidad, Monto )" _
& " SELECT Facturas.FacturaID, Factura2.Bodega, Factura2.item, Sum(Factura2.Cantidad) AS SumOfCantidad, Sum(Factura2.Monto) AS SumOfMonto " _
& " FROM Facturas INNER JOIN Factura2 ON Facturas.FacturaID = Factura2.Factura " _
& " GROUP BY Facturas.FacturaID, Factura2.Bodega, Factura2.item " _
& " HAVING (((Facturas.FacturaID) = Forms.Facturas.FacturaID ));"
Thanks in advance!