Must preview form twice to load fully

  • Thread starter Thread starter halfbodyguy
  • Start date Start date
H

halfbodyguy

I am sure I am doing something wrong, but I have a form that loads
errors if i open it straight up, but if i open it, then drop back to
design, then back into preview it works perfect...

The only events I run is an OnOpen, OnCurrent...

3 subforms with events as well. They work perfect once loaded the 2nd
time, but they get their sources from the main form, which doesn't
work first time...


Any ideas? or any more details that would help?

-Geoff
 
In
I am sure I am doing something wrong, but I have a form that loads
errors if i open it straight up, but if i open it, then drop back to
design, then back into preview it works perfect...

The only events I run is an OnOpen, OnCurrent...

3 subforms with events as well. They work perfect once loaded the 2nd
time, but they get their sources from the main form, which doesn't
work first time...


Any ideas? or any more details that would help?

Please post the recordsources of the form and subforms, the Link
Master/Child Fields of the subforms, and the code you have in the Open
and Current events. Also, is there a particular error code or message
that you're getting, or is it just "#Error" in the bound controls?
 
I am sure I am doing something wrong, but I have a form that loads
errors if i open it straight up, but if i open it, then drop back to
design, then back into preview it works perfect...

The only events I run is an OnOpen, OnCurrent...

3 subforms with events as well. They work perfect once loaded the 2nd
time, but they get their sources from the main form, which doesn't
work first time...


Any ideas? or any more details that would help?

-Geoff

Correct the errors in your subform's master/child link fields, or their
Recordsources, or your code.

Since we cannot see any of these from here, and since you didn't post any
indication of the error messages you're getting, it's hard to be more
specific.

John W. Vinson [MVP]
 
I am sure I am doing something wrong, but I have a form that loads
errors if i open it straight up, but if i open it, then drop back to
design, then back into preview it works perfect...

The only events I run is an OnOpen, OnCurrent...

3 subforms with events as well. They work perfect once loaded the 2nd
time, but they get their sources from the main form, which doesn't
work first time...


Subforms are initialized before the main form, so the
subforms can not refer to the main form in their Open, Load
and first Current event.

Often, this is not all that important and you can avoid the
errors by just trapping and ifnoring them. If it is
important, then add a little routine to each subform to call
the events that generated the errors. Then cal those
routinge from the main form's Load event.
 
Back
Top