G
Guest
I am using a query to build the dataset for a report. When I begin the code
below, the query works fine. After I exit the loop, the query doesn't work.
I assume it has something to do with the Update queries, but any ideas on how
to overcome the issue?
I believe this is enough code to see what is going on. Let me know if you
need to see more.
Thanks, in advance.
Sharkbyte
With Rst1
.MoveFirst
Do Until .EOF
gblSupplier = Rst1!alternateshipvia
MyStatus = Rst1!ItemID
gblItemID = MyStatus
gblCostPlus = DLookup("freight", "inventory...
gblCost = DLookup("discprice", "tblsalesorderdetails...
MyQty = Rst1!Quantity
DoCmd.RunSQL ("update tblpolinedistributionlocal ...
DoCmd.OpenForm "subfrmfillbackorders2", , , , , acDialog
DoCmd.RunSQL ("update tblpolinedistributionlocal...
DoCmd.RunSQL ("UPDATE tblSalesOrderDetails...
DoCmd.RunSQL ("insert into tblfulfillbackorderslocal...
DoCmd.RunSQL ("update tblbackorders...
.MoveNext
Loop
End With
DoCmd.OpenReport "rptfillbackorders2", acViewPreview, , , acDialog
below, the query works fine. After I exit the loop, the query doesn't work.
I assume it has something to do with the Update queries, but any ideas on how
to overcome the issue?
I believe this is enough code to see what is going on. Let me know if you
need to see more.
Thanks, in advance.
Sharkbyte
With Rst1
.MoveFirst
Do Until .EOF
gblSupplier = Rst1!alternateshipvia
MyStatus = Rst1!ItemID
gblItemID = MyStatus
gblCostPlus = DLookup("freight", "inventory...
gblCost = DLookup("discprice", "tblsalesorderdetails...
MyQty = Rst1!Quantity
DoCmd.RunSQL ("update tblpolinedistributionlocal ...
DoCmd.OpenForm "subfrmfillbackorders2", , , , , acDialog
DoCmd.RunSQL ("update tblpolinedistributionlocal...
DoCmd.RunSQL ("UPDATE tblSalesOrderDetails...
DoCmd.RunSQL ("insert into tblfulfillbackorderslocal...
DoCmd.RunSQL ("update tblbackorders...
.MoveNext
Loop
End With
DoCmd.OpenReport "rptfillbackorders2", acViewPreview, , , acDialog