Subreport on navigationsubform will not show unless requery :( (1 Viewer)

ahmed_optom

Registered User.
Local time
Today, 07:56
Joined
Oct 27, 2016
Messages
93
Ok, so here is the situation.

we have a mainform, then the navigationsubform. On the navigationsubform is a subform which has sourceobject of a report.

This report is based on a query which references a textbox on the mainform.

The issue is that the report is always empty unless you requery it after everything is loaded.

My understanding is that subforms load first, so its trying to reference a textbox on the mainform which hasnt been populated yet.

So i put a button to vba requery the child subform which makes the data in the report show fine.

However, when ever I try to requery the subform from anywhere else, its still blank.

I seem to have the reference fine, as i tested changing the name of the refresh button.

this is what im doing at the moment.

[Forms]![Main Menu]![NavigationSubform].Form.[Child303].Requery

It doesnt have an error, it just doesnt appear to requery or show any data in the report.
However if I click the requery button i made on the form which is :

Me.Child303.Requery

it shows the data.

Its starting to stress me out.....
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:56
Joined
May 7, 2009
Messages
19,247
try to Requery the navigationsubform:

[Forms]![Main Menu]![NavigationSubform].Form.Requery
 

ahmed_optom

Registered User.
Local time
Today, 07:56
Joined
Oct 27, 2016
Messages
93
try to Requery the navigationsubform:

[Forms]![Main Menu]![NavigationSubform].Form.Requery

Hi Arnelgp,

I hope your well.

Should i try this from the main form onload event do you think?
 

ahmed_optom

Registered User.
Local time
Today, 07:56
Joined
Oct 27, 2016
Messages
93
try to Requery the navigationsubform:

[Forms]![Main Menu]![NavigationSubform].Form.Requery

I tried this in the onload from main, and it didnt work, the report is still empty.

Im guessing its because the query is trying to pull data from the textbox which hasnt been loaded yet, as the main form will load last?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:56
Joined
May 7, 2009
Messages
19,247
is the textbox bound?
do it on the Main navi form's load event or timer event.
 

Users who are viewing this thread

Top Bottom