Disappearing Data?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Hi Sharkbyte

you are not refreshing your tables...

currentdb.tabledefs.refresh
DoEvents

you may need to do this between each step so that each
statement sees all the changes so far

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Back
Top