Do Recordsets Automatically Update?

kdm3

Registered User.
Local time
Today, 01:59
Joined
Aug 2, 2004
Messages
43
Hi,

I'm writing a procedure to do some pretty complex stuff, but basically it checks how much stock is available, and allocates what it can to a specific order, and generates a PO if there is insufficient stock for the order.

I am using dao recordsets to do the allocating, but realised that I could have a problem.

What I want (need) to know is whether a recordset (based on a query) automatically updates when the source data is modified (e.g. stock is allocated - reducing the free stock), or whether the data would have to be requeried to reset the data. I ask because obviously I don't want to double allocate stock!?

Plus, if relevant how does one requery a recordset?
 
Worse than I thought...

Sorry to dig this back up but I'm having serious problems...

I've run my code printing numerous values as I go, and to my horror I have found that because my recordsets are based on queries, they do not update when changes are made.

My application allocates stock depending on the amount of stock on-hand and on-order, and generates new order requirements for stock which needs allocation...

However, when stock is assigned to an order the recordset does not update, so the code allocates more stock, the result being that the code allocates more stock than is available - completely messing everything up...

The easiest solution is to requery the recordsets. My basic question is this:

I assume I would have to set up a control to requery all the recordsets have (5 in all). However, I am unsure whether I need to requery the recordset itself - no idea how I'd do this - or whether, if I was to requery the query the recordset is based on, the recordset itself would automatically update?

I don't know how much sense this makes, but I would be thankful of any advice on the subject - I've spent ages getting this beasty to do what I want, in isolation, and I didn't anticipate this much trouble putting it all together.
 

Users who are viewing this thread

Back
Top Bottom