Forms- storing a field based on a query

SanHall

New member
Local time
Today, 09:02
Joined
Dec 20, 2001
Messages
7
Hi, just wondering if anyone can help. I am so glad I acciddently stumbled into this forum.Since my knowledge on Access is basic to moderate and have taught myself most of what I know, this forum is very useful.

I have created a form based on a table and part of the fields in this form are entered by someone and other fields are filled based on a query. This is my scenario:

One of my operators opens a form, selects a part number, clicks on continue, this opens a second form for entering data and stores the selection from the first form. ( I choose not to use the subform feature) The operator can now add information such as date, operator number and quantity of parts produced.

Operators enter their quantity produced in a combobox field labelled # 1. They tab to the next Combobox field labelled # 2 which runs a query giving the yearly total plus the quantity just entered in the field #1.

What I cannot do is store that value into my underlying table.

I need to know this value before the dies are sent to another department inwhich those operators then update the table to show that the quantity has been set back to zero.

I know that storing calculated values are a bad thing, but my boss has asked me to store this information so that we can run reports for all the dies based on a previous date and know how many parts these dies have produced at any given time. Can anyone help. Please. I know there is a way, I just can't figure it out. I appreciate any help. Thanks Sandra
 
Storing calculated data in table is only a bad thing if the data will always be there to calculate from. There are certain valid circumstances in which it makes sense to store it.

You may be able to store the data in your table by utilizing a command button similar to your Continue button above. However this relies on your operators remembering to hit it. There are several other events that could work, including the OnExit or OnLostFocus events of the #2 combo box. I believe you can use Tables![YourTable].[Field] = Me.cboComboNo2, but someone else will correct me hopefully if I am mistaken. The Expression Builder will help you get the correct syntax for your particular situation.

HTH,
David R
 
Tried your suggestion about creating the code both in the exit and onlost focus and I am having problems. I am getting an error asking to define variable.

Not sure what this means.
 
Did you create the field on your table to store the data with?
 

Users who are viewing this thread

Back
Top Bottom