monoDeveloper
Programmer
- Apr 16, 2013
- 16
Hi everybody
I run SQL query to add dat from another table based on form object data, it works when i save as separate query but failed when i run inside VBA script command :
This is Saved query code:
I want to know the reason & solution please.
I run SQL query to add dat from another table based on form object data, it works when i save as separate query but failed when i run inside VBA script command :
Code:
[COLOR=#4E9A06]'Append data to Temporary table[/color]
DoCmd = " INSERT INTO SupplyOrderDetails_Temp " & _
" ( Supp_Order_SN, ItemID, Sup_Ord_Item_ExDate, Ord_Old_QTY ) " & _
" from ( SELECT Supp_Order_SN, ItemID, Sup_Ord_Item_ExDate, Sup_Ord_QTY " & _
" FROM SupplyOrderDetails " & _
" WHERE (Supp_Order_SN= " & Int([cbo_Order_SN]) & "))"
This is Saved query code:
SQL:
INSERT INTO SupplyOrderDetails_Temp ( Supp_Order_SN, ItemID, Sup_Ord_Item_ExDate, Ord_Old_QTY )
SELECT Supp_Order_SN, ItemID, Sup_Ord_Item_ExDate, Sup_Ord_QTY
FROM SupplyOrderDetails
WHERE (Supp_Order_SN=Forms!frm_Update_Receive_Supply_Order!cbo_Order_SN);
I want to know the reason & solution please.