Requery Subform

mike60smart

Registered User.
Local time
Today, 09:53
Joined
Aug 6, 2017
Messages
2,141
Hi Everyone
For some reason I cannot get the following to work.

I have a Main Form named "frmQuotes"
On the Main Form I have Sub1 named "frmQuoteElementsSubform"
When I run an On Click Event from Sub1 I need to refresh Sub2 on the Main Form

The name of Sub2 is "frmProfileOrdersSubform"

I have tried the following with no success:-

[Forms]![frmQuotes].[frmProfileOrderssubform].[Form].Requery

[Forms]![frmQuotes]![frmProfileOrderssubform].Requery

[Forms]![frmQuotes]![frmQuoteElementsSubform]![frmProfileOrderssubform].[Form].Requery

Any help appreciated.
 
I guess it starts with me.parent..........
 
Code:
Parent.Form.frmProfileOrderssubform.Form.Requery

I would throw in a me.dirty = false just for good measure
 
A little more complex but without dependencies:
Sub1 raise event "QuoteElementXXX" -> main form listens to the event -> and main from call requery of Sub2
 
Before attempting different syntax options, just check your reference works. Verify if something like [Forms]![frmQuotes].[frmProfileOrderssubform].[Form].Name works for your case. If it does, there's no need to explore other syntax options, simply use Requery after the reference. If your reference does not work, then modify it.

If Requery doesn't produce the expected results, investigate the data's behavior. Make a change from the form, open the relevant table and ensure the change is there. If no changes are there, commit the record with Me.Dirty = False and test for modifications by opening the table again. If there are still no changes, induce a modification directly in the table. If this alteration doesn't reflect in the form, verify your data source is correct. If the form updates correctly, confirm that you're genuinely modifying the data. Repeat this process as needed.
 
Last edited:
Hi Everyone

My apologies for the late reply.

This actually works:

Code:
[Forms]![frmQuotes]![frmProfileOrderssubform].Requery

The problem was down to me as the subform was based on 2 tables.

Removed the other table and now works fine.

Many thanks for looking.
 

Users who are viewing this thread

Back
Top Bottom