🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual
Article #214

Re: VB6 Bug?

#214
From: Don
Date: Wed, 23 Jul 2003 20:33
83 lines
3595 bytes
I forgot to mention the following::

In the MDI Child form you could also do:

Option Explicit
Dim MyVarBB As MDIForm1
Private Sub Form_Load()
Set MyVarBB = MDIForm1 'Not Using .MyVarAA it will be the same (kinda)
'In this case MyVarAA in the MDIForm is not needed at all... 
MyVarBB.Command1.Visible = False
End Sub


On Wed, 23 Jul 2003 20:28:46 GMT, Don@home.com wrote:

>On Wed, 23 Jul 2003 21:32:56 +0200, "sjoerd" <iwi@iwi.myweb.nl> wrote:
>
>>
>>"Jan Hyde" <StellaDrinker@REMOVE.ME.uboot.com> wrote in message
>>news:ohvshvk1jgtihtm0u278gjtpskd7e2k0me@4ax.com...
>>> "sjoerd" <iwi@iwi.myweb.nl>'s wild thoughts were released on
>>> Wed, 23 Jul 2003 12:35:00 +0200 bearing the following fruit:
>>>
>>> >Hi,
>>> >
>>> >I have a problem in a MDI-project.
>>> >I declared a variable MyVarAA in frmMain.frm (Public MyVarAA) in the
>>General
>>> >Declaration section)
>>> >
>>> >I need this variable in Form1, so in the Form_Load of this form I wrote:
>>> >
>>> >MyVarBB = frmMain.MyVarAA
>>> >
>>> >When trying to run the program I get the following error:
>>> >
>>> >Run-time error 426 (only one MDI-form allowed).
>>> >
>>> >The debug-information tells me:
>>> >
>>> >frmMain.MyVarAA = <object variable or with block variable not set>
>>> >
>>> >Acoording to the book I use (Using Visual Basic 6) is this the way to do
>>it.
>>> >Error in the Book? Bug in VB? Something else?
>>> >
>>> >Thanks,
>>> >
>>> >Sjoerd
>>> >
>
>First off I don't know why you want to do it this way BUT here's something to
>look at...
>
>In the MDIForm do:
>
>Option Explicit
>Public MyVarAA As MDIForm1 'Declare an Object Varible
>
>Private Sub MDIForm_Load()
>'Just declaring it is only half the process. Have to use the
>'Set blah = blahblah to actually create the references..
>Set MyVarAA = MDIForm1 'Set the references to This Form
>End Sub
>
>Then in Form1 (MDIChild form) do:
>
>Option Explicit
>Dim MyVarBB As MDIForm1 'Declare an Object Varible (early binding)
>
>Private Sub Form_Load()
>Set MyVarBB = MDIForm1.MyVarAA 'Set the References to that in MDIForm
>'Now MyVarBB has all the references of MDIForm1
>End Sub
>
>
>Have a good day...
>
>Don

Have a good day...

Don
Technical Details
Message-ID: <ktrthvkv10g7tgb853g5cu48mphi32lcq2@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller.gnilink.net!nwrddc01.gnilink.net.POSTED!1fcba382!not-for-mail
References: <bfloct$kk1$1@news1.tilbu1.nb.home.nl> <ohvshvk1jgtihtm0u278gjtpskd7e2k0me@4ax.com> <bfmntj$g15$1@news1.tilbu1.nb.home.nl> <pmrthvs19ooi83j2hgbial8hdnuov0tnvm@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 110e3b,88f30e77b5d7071c
X-Google-Attributes: gid110e3b,public
X-Google-Thread: f645d,88f30e77b5d7071c
X-Google-Attributes: gidf645d,public
X-Google-Thread: f51ba,88f30e77b5d7071c
X-Google-Attributes: gidf51ba,public
X-Google-ArrivalTime: 2003-07-23 13:33:48 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller.gnilink.net!nwrddc01.gnilink.net.POSTED!1fcba382!not-for-mail
From: Don@home.com
Newsgroups: comp.lang.basic.visual,comp.lang.basic.visual.misc,dk.edb.programmering.basic.visual-basic
Subject: Re: VB6 Bug?
Message-ID: <ktrthvkv10g7tgb853g5cu48mphi32lcq2@4ax.com>
References: <bfloct$kk1$1@news1.tilbu1.nb.home.nl> <ohvshvk1jgtihtm0u278gjtpskd7e2k0me@4ax.com> <bfmntj$g15$1@news1.tilbu1.nb.home.nl> <pmrthvs19ooi83j2hgbial8hdnuov0tnvm@4ax.com>
X-Newsreader: Forte Free Agent 1.92/32.572
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 83
Date: Wed, 23 Jul 2003 20:33:46 GMT
NNTP-Posting-Host: 67.225.111.138
X-Complaints-To: abuse@verizon.net
X-Trace: nwrddc01.gnilink.net 1058992426 67.225.111.138 (Wed, 23 Jul 2003 16:33:46 EDT)
NNTP-Posting-Date: Wed, 23 Jul 2003 16:33:46 EDT