We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Requery subform from a subform

mtrussell
mtrussell asked
on
Medium Priority
455 Views
Last Modified: 2012-05-11
I have a form with two subforms on a main form that are not bound together.  In subform1 I have a field that when I click on it I want it to requery the totals in subform2.  I would like to add the code to the On Click module of the field.

How do I do this?  
Comment
Watch Question

Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
Suppose the controls that hold the subforms on the main form are called subform1 and subform2 (the controls can have a different name than the form they contain). You can add this code in the onclick event of the control on subform1:
me.parent!subform2.form.requery

'Me' refers to the form subform 1. '.Parent' refers to the form containing the subform. '!subform2' refers to the control on the main form. '.Form' refers to the form inside the subform control.

Author

Commented:
Thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.