Getting data from Sub Form to Main

pdwalke4

Registered User.
Local time
Today, 02:47
Joined
Mar 10, 2007
Messages
13
I have calculated the SUM total of a cost in an order form (e.g has 3 items). How do can i transfer the data to a Total field in the main form (i.e main form holds the total cost of items)?

Table details

Main Form (Orders1 with field name Order Value)
Sub From (Items1 with field name subtotal)

Badger
 
Am quite new to VB to you translate that into my field and table details from above.

Sorry if it should be obvious.
 
At the moment have got the system to pick up the total in the subform which updates everytime the Quantity field is updated. Everytime i try to add to this by asking it to pick up the value in the Order Value field in the Main form (testing by using a msgbox) i get the error object expected.
 
MsgBox (Forms!school1.subtemp) will give me a value from my main form and i can pass a value from subform2 (items1) to this form but i cant pass the value directly to subform1 (Orders1). I have fudged it a little by passing the value to main form and then to subform1.

Second problem, I have a filed in subform 2 calculating the subtotal of the records with the control source being =sum([itemcost]) but it always misses the last record in the form and does not update each time i change quantity field.
 
I thought you were trying to get a value from a SubForm to a control on the MainForm. Now it seems like you are trying to get a value from a SubForm to another SubForm on the MainForm. Did I read it correctly? The second problem is probably because you haven't saved the record yet. Move off of the last record with your cursor and see if that gets everything updated.
 
Sorry, that was me having a blonde moment. IThere is a main form and 2 sub forms Have prety much sorted both (although isn't very efficient). I had to add a refresh form button to update subform2 and subtotal field and the save button passes the value to main from. A process button on subform 1 reads the value from main form and updates the OrderValue field.
 
There is always more than one way to skin a cat in Access. I suspect you could make *everything* happen without pressing any additional buttons. If you want to post a stripped down compacted version of your db, we can look at it and make suggestions. You can remove any sensitive data but leave enough sample data so we can run the form.
 
There is always more than one way to skin a cat in Access. I suspect you could make *everything* happen without pressing any additional buttons. If you want to post a stripped down compacted version of your db, we can look at it and make suggestions. You can remove any sensitive data but leave enough sample data so we can run the form.

Think i have pestered you enough for one day (and my head is spinning at the mo from work done on it today). Isn't any sensative data on it am doing it for a friends small business and only test data in at the mo. Will look back at it after have sorted the long lists of queries and reports that he wants (is the last form i need to sort (i think).

Thanks for trying to help
 
No problem. We'll be here if you need additional assistance.
 

Users who are viewing this thread

Back
Top Bottom