Stop subforms loading prior to Main Form

  • Thread starter Thread starter Guest
  • Start date Start date
You could leave its SourceObject blank.

Whether that's a useful idea would depend on why you need to do this.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Cathi said:
Is there a way to stop a subform loading prior to the main form? If so,
how?
 
Cathi, I don't follow what you are trying to achieve here.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Cathi said:
I have the source obj blank, however when I populate it on form open I am
getting a parameter type prompt for the MasterFields link. I don't get the
prompt for the ChildFields (discovered this when steping through the code),
any thoughts, suggestions?
 
Allen, sorry (now I'll have to be lengthy, was trying to avoid that :-)

I have a form with 2 subforms, this form will hold the same data but from different recordsets. So, to avoid making mulitiple forms that are exactly the same I want to be able to set the recordsouce from the "onclick" event of the switchboard

What is occuring is that regardless of where I load the subforms from the mainforms events I am getting a prompt for the masterfield link. However, if I just click through the prompt box the subform loads and links correctly. It seems to be a timing issue where the subform always loads prior to the mainform, regardless, and can not find the linking fields until everything is fully loaded.

I need to figure out how to stop that prompt box from appearing; everything that I have tried fails to stop the prompt box from appearing. I am on the verge of slopping design and making a form for each recordset - arrgh

Hope that helps make it clearer and you have better ideas then i have had <vbg

Cath
 
Okay. You cannot change the order of execution of the Access events, but you
can usually work around them.

One option might be to save the form with nothing in the
LinkMasterFields/LinkChildFields properties, and assign them in the Open
event of the main form. This bypasses the problem at the time the subform is
being opened.

Another option might be to use the Open event of the main form to assign the
RowSource of each subform control. This bypasses the need to use some/all of
the LinkMasterFields/LinkChildFields properties.

I've never tried using the Error event of the subform to just ignore the
error and continue anyway: probably would not work.

Provided there was something on the main form (e.g. hidden text box) with
the same name as the field(s) in LinkMasterFields, the message should
disappear?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Cathi said:
Allen, sorry (now I'll have to be lengthy, was trying to avoid that -) )

I have a form with 2 subforms, this form will hold the same data but from
different recordsets. So, to avoid making mulitiple forms that are exactly
the same I want to be able to set the recordsouce from the "onclick" event
of the switchboard.
What is occuring is that regardless of where I load the subforms from the
mainforms events I am getting a prompt for the masterfield link. However,
if I just click through the prompt box the subform loads and links
correctly. It seems to be a timing issue where the subform always loads
prior to the mainform, regardless, and can not find the linking fields until
everything is fully loaded.
I need to figure out how to stop that prompt box from appearing;
everything that I have tried fails to stop the prompt box from appearing. I
am on the verge of slopping design and making a form for each recordset -
arrgh.
 
Back
Top