Subform Requery

spazmonkey

New Member
Joined
Dec 9, 2004
Messages
40
How do make a subform requery?

I have a Form(a) with a subform(b) and one without(c). Form(c) has the same data source as (b). (c) is for adding/editing data. (b) is for viewing data.

I have tried to use the Close event of form (c) to requery form (b). This does not work.

Is there something similar to a gotocontrol that will let me select a subform and requery it???

Cheers

:oops:
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I think I have an idea.

Try following: on the close-event of form(c) you close form(a), then form(c) and then re-open form(a). Now form(a) should automatically requery ....
 
Upvote 0
Hi,

Is your Main form based on a Table/Query?

If it is (and it should be) the Parent/Child propeties need to set.
then on an event on the Main form, say a button click
Use Me.Requery in the code
The subform will update accordingly.

Also, What are the subforms based on?
 
Upvote 0
Thanks for your guidance Ian Mac and TONNIC.

TONNIC Is there another option instead of closing and re-opening the form. I agree that this will work but it may look clumsy (will try)/

Ian Mac There are three forms . One with a subform and one without. Two of these forms are linked to the same table. How do I link the Parent/Child properties of unrelated form to the subform? Am I missing the point?


I have tried using the OnActivate event of the Parent but this is still not doing the trick.

Thanks all for you help so far. :p (y)
 
Upvote 0
spazmonkey said:
Thanks for your guidance Ian Mac and TONNIC.

TONNIC Is there another option instead of closing and re-opening the form. I agree that this will work but it may look clumsy (will try)/

Ian Mac There are three forms . One with a subform and one without. Two of these forms are linked to the same table. How do I link the Parent/Child properties of unrelated form to the subform? Am I missing the point?


I have tried using the OnActivate event of the Parent but this is still not doing the trick.

Thanks all for you help so far. :p (y)

Sorry, I'm not following you, (it is christmas eve though)


You have three forms, 1 with a subform form and one without, that's 2 or are you counting the subform?
Can you explain a little more,

e.g.

I have 1 Main form with the Control Source A and on it a subform Control Source B, etc.

Edit: Doh, you have explained upstairs. what about the AfterUpdate event on the subform?
Also, when does each need to be view, i.e. sequence of events in the Application.

Cheers,
 
Upvote 0

Forum statistics

Threads
1,221,864
Messages
6,162,497
Members
451,770
Latest member
tsalaki

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