Link to home
Start Free TrialLog in
Avatar of EASCOA
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.
Avatar of SolveEtCoagula07
SolveEtCoagula07
Flag of Germany image

If you post a copy of your database I can try to assist you.
Avatar of Rey Obrero (Capricorn1)
Avatar of EASCOA
EASCOA

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
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.
Avatar of EASCOA

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?
Avatar of EASCOA

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:

Function RequerySubform()
    Forms!frmEnterUtilityCutsPermit!frmChargeRatesSubform.Form.Requery
End Function

Open in new window


3.  Add the following command to the end of your macro for the Add button

Runcode RequerySubform()
Avatar of EASCOA

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
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:

Function RequerySubform()
    Forms!frmEnterUtilityCutsPermit!frmChargeRatesSubform.Form.Requery
End Function

Open in new window


3.  Add the following command to the end of your macro for the Add button

Runcode RequerySubform()

User generated image
User generated image
User generated image
Avatar of EASCOA

ASKER

Thanks for all the help.
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial