Disappearing Data?

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
 
S

strive4peace

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

*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top