Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Background Load a form

Status
Not open for further replies.

IanLondon

Programmer
Oct 20, 2003
1
GB
I am trying to load a form without showing it, when another form (my primary form) loads. This is because the second form is slow to load and I would rather have the delay while the initial form is loading.

I have used this code:

Private Sub Form_Load()
Dim ObjName As Object

Set ObjName = ClientMenu

Load ObjName

End Sub

But it fails with a data type mismatch error. It seems I am not referencing the form name correctly.

I am now using:
DoCmd.OpenForm "ClientMenu", acNormal, , , , acHidden

as a substitute, but the second form appears briefly on the screen during loading, which I would prefer to avoid. (Doesn't look too professional!)

Any assistance would be welcome.
 
The reason for this is that the form has to load before running the code.

Why not open both in turn from your subroutine.

DoCmd.OpenForm "ClientMenu", acNormal, , , , acHidden
DoCmd.OpenForm "Form1"


Regards
BrianB
** Let us know if you get something that works !
================================
 
I think it would work if you used '
Code:
Dim ObjName As UserForm
' rather than '
Code:
As Object
'.

N.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top