Hold A Screen Shot

  • Thread starter Thread starter Arturo
  • Start date Start date
A

Arturo

I posted an earlier question but maybe need to rephrase it.
How do you run an update query on a form without closing it?
For instance, I have a form with subforms that I use to enter
and update data. On one subform (continuous forms) I have
a button control that will update the address to the address
in the underlying table of one of the other subforms. The only
way I have learned to do this is to close the form, run the
update query, and reopen the form.

This works quite well but you can see the form close and
reopen. Can you help?

Thank you.
 
You can run the button code, just add one item to it:

Me.YourSubformContainerOnMainForm.Form.Requery

where YourSubformContainerOnMainForm is the name of the control on the main
form that houses the subform, not the name of the subform itself (unless it
and the subform container are named the same). And, the part that says
..Form. just leave it exactly as it is at .Form.

For more of an explanation of subforms, go here:
http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx


--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________
 
What if I run the procedure from the subform?

boblarson said:
You can run the button code, just add one item to it:

Me.YourSubformContainerOnMainForm.Form.Requery

where YourSubformContainerOnMainForm is the name of the control on the main
form that houses the subform, not the name of the subform itself (unless it
and the subform container are named the same). And, the part that says
.Form. just leave it exactly as it is at .Form.

For more of an explanation of subforms, go here:
http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx


--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________
 
Back
Top