Requery Automatically

will

Registered User.
Local time
Today, 06:14
Joined
Jul 11, 2001
Messages
18
Hey, I have a main form(frmInfo) with a subform(frmHistory), and then I have links to other forms for each of the twelve months(frmJanuary-frmDecember). Basically, I store a running total of the values of text boxes in each of the twelve forms and then display the value in a text box that is based on a query in "frmHistory". I want to display the updated amount after I enter the new value and close the frmJan. I know I am supposed to set the code to run after the close event of the update form, basically I need to requery the value of a text box displaying values off a query after the form closes.
Im using this code:
Forms!Info!History!Expr1.requery
but keep getting this error message:
"Database cannot find field "History" in expression"
Any ideas? It seems fairly simple,
thanks,
Will
 
Are you saying you have seperate fields / tables for each month? There seems to be a design problem here, it isn't normal practice to store a running total in a relational database but to calculate it.
 
Yes I have a different table for each month instead of one table for all twelve. The reason being that in each month different things can happen to different people that need accounted for, (ie, notes, special conditions, or situations) basically my database is not very efficient, however have less than 500 records so you do not really notice time lapses, slower processing, etc. So, back to my original question, I am calculating vales in different tables(the 12 months) to display as a Sum on my main form. It works well because I based the Text box on a query that sums the values in the multiple tables but will not update the Sum as I enter/change values in the tables. Basically I think I need to requery the text box on my main form after I update values on the subform. Get it? Hope this clarifies a little of my inexperience.
smile.gif

Will
 
Just suggesting an AfterUpdate on your subform that runs the query(that totals the individual months) and the DoCmd.Refresh on you main form. I guess that will update all your data and your totals.
 

Users who are viewing this thread

Back
Top Bottom