PDA

View Full Version : Control Not Updating



tyndale2045
11-25-2008, 07:58 AM
I do not know how to explain my problem without uploading my mdb file. So, for any kind souls who are willing to take a look, here is how you can see what is going wrong.

Open the mdb file and you will be confronted with a switchboard. Click on ?Enter Daily Chick Floor Usage.? This is a form that looks identical to a sheet that is used by employees in our hatchery. Once the paper copy is filled out, someone enters all of the numbers into the ?Total? column on this form.

However, it occasionally happens that a couple of days pass before anyone enters the info into this form. So, they might have a sheet in their hand from 11-23-2008 and another sheet from 11-24-2008. If this happens, the only thing they need to do (after they fill out the info from their first sheet) is change the date in ?Date? control, and they will either start with an empty sheet, or (if they entered an old date) the sheet will show previous usage. Go ahead and make the date say ?11/18/2008? and hit enter. You?ll see what I mean.

Here is my problem: Make the date read ?11.25.2008?. Scroll down to the very last item called ?Diluent Biomune 1600 ml.? Enter a number there, say, 5, and then HIT ENTER (do not click to another control). Now IMMEDIATELY (don?t click on anything else) go to the date control and change the date to the day before or the day after. The 5 is still sitting there right next to the Diluent Biomune 1600 ml. That control is either not updating, or not being ?repainted? to be blank. But I don?t know why, and I have a feeling this will really confuse our employees if they are entering multiple days in one sitting. Of course, it only happens with the very last item on the sheet. Everything else adjusts (according to the date) just fine. So, why is this last item not changing? Is there a quick fix?

Any suggestions will be greatly appreciated.

Thanks,
Jim

CreganTur
11-25-2008, 08:30 AM
I've only spent a few minutes looking through your DB, but here's my initial thought:

I noticed that when the date changes on the form a Sub is called that pulls the data from your Inventory Transactions table and inserts it into the QueryColumn for your Products table. Why are you doing this? Why not use unbound textboxes and push the values from the Inventory Transactions table for the date directly to the Form's desired control?

That's why the 5 is stuck- its value is written to the QueryColumn field- it becomes a permanent value for that column, and you don't have any procedures to clear those values when a new date is chosen.

Does this make sense?

tyndale2045
11-25-2008, 08:53 AM
Randy,

Thanks for the reply, I appreciate your time.

I actually do have a procedure that clears the QueryColumn field. If you'll try entering a few other quanitities on the form, in addition to that darn bottom one that is giving me trouble, you'll see that it updates. The procedure is called "ClearColumnInProductsTable" and it is located in the module entitled SQLProcedures. But, alas, it doesn't look like its working all that good does it?

tyndale2045
11-25-2008, 08:55 AM
Also: I'll spend some time seeing if I can implement your suggestion. I'm a newbie, though, so I'll probably fire back a silly question in a little while.

Thanks again.

tyndale2045
11-25-2008, 09:07 AM
Ahhh . . . now I remember why I did it this way.


I did not know (and still do not know) how to create a form that would be based on the "Inventory Transactions" table that would list only unique values (for the vaccines). Every way I tried it, it simply listed every single transaction for every single vaccine.

Is it possible to create a form, similar to the one I've already made, that is based off of the "Inventory Transactions" table?