EASCOA
asked on
Access 2007
I have a main form that displays a subform below. I would like for the subform to display what is entered on the main form immediately. I have a save button on the main form and a add button is allow for multiple entries. But, the subform does not update until I navigate completely out of the form and come back in. Any help will be deeply appreciated. Thanks.
If you post a copy of your database I can try to assist you.
follow the instruction from here, to create a form with subform
http://office.microsoft.com/en-us/access-help/create-a-form-that-contains-a-subform-a-one-to-many-form-HA010098674.aspx?CTT=1
http://office.microsoft.com/en-us/access-help/create-a-form-that-contains-a-subform-a-one-to-many-form-HA010098674.aspx?CTT=1
ASKER
The main input form is frmEnterUtilityCutsPermit and the tab that contains the form and subform I'm trying to get to work is "Repair Order". There is one record in the repair table...I have been just adding a new record to the Repair Order and trying to get it to update the subform display.
ExpertHelp-Copy.accdb
ExpertHelp-Copy.accdb
What exactly are you trying to display?
If your subforms are set up correctly, the key fields /linking fields from the main form will automatically populate in the subforms.
If your subforms are set up correctly, the key fields /linking fields from the main form will automatically populate in the subforms.
ASKER
Actually the subform is created from a query that does some calculations from results entered and a couple of selections entered on the main form. Do you think that is a problem?
ASKER
Sorry to answer the question I want to display the results.
Try this:
1. Create a new code module
2. Add the following function to the module:
3. Add the following command to the end of your macro for the Add button
Runcode RequerySubform()
1. Create a new code module
2. Add the following function to the module:
Function RequerySubform()
Forms!frmEnterUtilityCutsPermit!frmChargeRatesSubform.Form.Requery
End Function
3. Add the following command to the end of your macro for the Add button
Runcode RequerySubform()
ASKER
Being new to Access 2007...I'm afraid I may have put the code in the wrong place. Because it still doesn't work. Sorry for any inconvenience.
COAStreet-2013-12-3StartOfDay-Sw.accdb
COAStreet-2013-12-3StartOfDay-Sw.accdb
Unless I'm looking at the wrong form entirely, I don't see where you have tried this at all.
Recapping the steps, with pictures below (Your user interface may look a little different. The pictures are from Access 2010, but they should give you the right idea)
1. Create a new code module
2. Add the following function to the module:
3. Add the following command to the end of your macro for the Add button
Runcode RequerySubform()
Recapping the steps, with pictures below (Your user interface may look a little different. The pictures are from Access 2010, but they should give you the right idea)
1. Create a new code module
2. Add the following function to the module:
Function RequerySubform()
Forms!frmEnterUtilityCutsPermit!frmChargeRatesSubform.Form.Requery
End Function
3. Add the following command to the end of your macro for the Add button
Runcode RequerySubform()
ASKER
Thanks for all the help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.