I have a Main form with a subform.
The subform has a Table as it's record source. The user can go in and make entries to the underlying table.
When the user updates certain data in the subform (and the underlying table), I wish to accumulate some totals and set some yes/no flags (based on whether the user performed some functions or not).
I added some text boxes to the Main form and then, in the subform code, referenced them when i needed to accumulate or set the yes/no flags. This works wonderfully with one major issue, the user does not wish to stay on this form all day long, i.e. they need to be able to go in, make some updates then exit the application entirely. This may happen several times a day. Since the process must be re-entrant, the user entering and leaving the process several times throughout the day, I need to keep track of their activity somehow. ~ The first thing I noticed was that the text boxes would contain nothing when the form was loaded, thus I lose the information that I put into them when the user leaves the form and then returns later.
The only way I could think of to do this was to create an additional table which would consist of ONE record in which would be defined the two totals and three yes/no fields I need to keep track of. I then changed the text boxes on the the main form and bound them to the fields in the new table....... this did not work, i.e. the code would run with no errors however the record in the new table would never actually update at all.
I next tried creating a new subform with the new table containing the data I need to track as it's record source and changed the code to reference the fields; this would not work either.
Here is example of the code (this code is in the before update event of the subform the user makes the changes in)
'First entry for Sticky
If Me!Qty > 0 And curOriginalValueQty = 0 Then
Forms![FarmLibrarySelect]![ChandlerActivity].QTY = Forms![FarmLibrarySelect]![ChandlerActivity].QTY + Me!Qty
Me!Qty = is the field the user just updated
CurOriginalValueQty = is the value that was in the field before the user made a change to the data
FarmLibrarySelect = is the Main form
ChandlerActivity = is the new subform i created that has the new table containing the fields I am trying to track.
ChandlerActivity.QTY = is the data field in the table taht i am trying to accumulate to.
this code runs ok, but as indicated, nothing happens to update the record in the table, likewise, the field in the subform does not reflect anything after the code runs.
I am guessing, but i am thinking that somehow, i need to tell Access to do the update to the record ? Thinking further, once i do update a field in the record, how does Access know that i want to update this very same record
later?
Maybe my approach is all wet here.
basically, if someone can tell me how to accomplish what i need to do I would be most appreciative.
1. have a form with table the user updates.
2. user may come in and do this multiple time a day then
exit the form.
3. Have 5 pieces of information I need to track while the
user is doing all this.
4. User must have visibility to these fields as they are
making updates, then when they leave the form and return
later, see them as they were when they exited previously.
a. total of quantities entered in column "A"
b. total of quantities entered in column "B"
c. User clicked on button "C" yes/no
d. User clicked on button "D" yes/no
e. User clicked on button "E" yes/no
The subform has a Table as it's record source. The user can go in and make entries to the underlying table.
When the user updates certain data in the subform (and the underlying table), I wish to accumulate some totals and set some yes/no flags (based on whether the user performed some functions or not).
I added some text boxes to the Main form and then, in the subform code, referenced them when i needed to accumulate or set the yes/no flags. This works wonderfully with one major issue, the user does not wish to stay on this form all day long, i.e. they need to be able to go in, make some updates then exit the application entirely. This may happen several times a day. Since the process must be re-entrant, the user entering and leaving the process several times throughout the day, I need to keep track of their activity somehow. ~ The first thing I noticed was that the text boxes would contain nothing when the form was loaded, thus I lose the information that I put into them when the user leaves the form and then returns later.
The only way I could think of to do this was to create an additional table which would consist of ONE record in which would be defined the two totals and three yes/no fields I need to keep track of. I then changed the text boxes on the the main form and bound them to the fields in the new table....... this did not work, i.e. the code would run with no errors however the record in the new table would never actually update at all.
I next tried creating a new subform with the new table containing the data I need to track as it's record source and changed the code to reference the fields; this would not work either.
Here is example of the code (this code is in the before update event of the subform the user makes the changes in)
'First entry for Sticky
If Me!Qty > 0 And curOriginalValueQty = 0 Then
Forms![FarmLibrarySelect]![ChandlerActivity].QTY = Forms![FarmLibrarySelect]![ChandlerActivity].QTY + Me!Qty
Me!Qty = is the field the user just updated
CurOriginalValueQty = is the value that was in the field before the user made a change to the data
FarmLibrarySelect = is the Main form
ChandlerActivity = is the new subform i created that has the new table containing the fields I am trying to track.
ChandlerActivity.QTY = is the data field in the table taht i am trying to accumulate to.
this code runs ok, but as indicated, nothing happens to update the record in the table, likewise, the field in the subform does not reflect anything after the code runs.
I am guessing, but i am thinking that somehow, i need to tell Access to do the update to the record ? Thinking further, once i do update a field in the record, how does Access know that i want to update this very same record
later?
Maybe my approach is all wet here.
basically, if someone can tell me how to accomplish what i need to do I would be most appreciative.
1. have a form with table the user updates.
2. user may come in and do this multiple time a day then
exit the form.
3. Have 5 pieces of information I need to track while the
user is doing all this.
4. User must have visibility to these fields as they are
making updates, then when they leave the form and return
later, see them as they were when they exited previously.
a. total of quantities entered in column "A"
b. total of quantities entered in column "B"
c. User clicked on button "C" yes/no
d. User clicked on button "D" yes/no
e. User clicked on button "E" yes/no