Link to home
Start Free TrialLog in
Avatar of Unimatrix_001
Unimatrix_001Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Using object or form for MDI variable & variable without triggering form load.

Hi there,

I've got a boot form, a main form (MDI) and a few smaller child MDI forms. The boot form loads up and gets some information off disk. This information is then put into a variable on the main form, however the main form uses that information in the load event. Although it seems a bit of a chicken and the egg, unable to set the information in the main form without triggering the main form load event, which in turn uses the information that was meant to be set before the load event fired.

Also, I'm trying to treat the child MDI forms as objects, as such:


Dim myMDIChild1 As Object
Dim myMDIChild2 As Object

Private Sub MDIForm_Load()
     Set myMDIChild1 = new mdiChild
     Set myMDIChild2 = new mdiChild

     myMDIChild1.someSub
     myMDIChild1.visible=True
End Sub


A small problem, but I'm guessing because I declared them as objects, I don't get my nice code completion come up when attempting to access a method or variable of myMDIChild1. Any code workarounds?


Thanks
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image


it's not possible to use a function, variable or member from a form without loading the form.
if you want to use the variable without loading the form, add it to a module instead.
SOLUTION
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

i stand corrected,

Unimatrix_001 : sorry for providing wrong information,

HTH-Jon : thanks for correcting me!
Avatar of Unimatrix_001

ASKER

Mark: No problem. Mistakes happen to even the best of us. ;) Cheers for the info Jon! Didn't realise that... :S