how to refresh/requery subform?

merlin777

Well-known Member
Joined
Aug 29, 2009
Messages
1,397
Office Version
  1. 2007
i have a form which contains a subform containing a query. two controls on the main form allow the user to enter parameters for the query but it doesn't update. i understand you need to requery the subform.

it would be good if it could requery after a new value has been entered but a 'refresh' button would do.


how wouldi go about that (pref without vba)
tia
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Use a button if they can change many controls. (usu 1 line of VB is needed...not full pages of code)
after all the changes, Use the BUILDER (the magic wand icon with elipsis) to make references to objects: forms!main!subform!form.requery
(notice the extra 'form')
 
Upvote 0
so i need a little bit of vba for a button. Where doesforms!main!subform!form.requery go? is this the vba you mentioned or a way of refreshing without a button?
 
Upvote 0
In whatever control you use to change values. If its only a combo box, it would go in the combo afterupdate event.
but if you have >1 control, you would need a button (to know when the user is done) so it would go in the button click event
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top