home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,230 of 10,840   
   Ralph to The Doctor   
   Re: Passing Variables.   
   13 Sep 06 12:07:19   
   
   From: nt_consulting64@yahoo.com   
      
   "The Doctor"  wrote in message   
   news:450828e7$0$17211$afc38c87@news.optusnet.com.au...   
   > A rather elementary question, In VB5, how can I pass a   
   > variable from one form to another?   
   >   
      
   To amplify on Mr. Earley's response.   
      
   There are several other mechanisms you might employ to "pass variables".   
   If you need a form to have some unique runtime information when loaded you   
   could create a "Init" method in the other form then call it before showing   
   the form.   
       Dim frmTwo As FSecondForm   
       Set frmTwo = New FSecondForm   
       frmTwo.Init Var1, Var2, Var3   
       frmTwo.Show   
      ...   
   You can possilbly carry this method a bit farther and create a 'Constructor'   
   with the 'Init' actually calling itself to open.   
      
   Another method is to actually pass a Reference of the first form to the   
   second and let the second form query it. (Usually a moderately bad idea as   
   sooner or later you will end up with circular references if you aren't   
   careful. )   
      
   -ralph   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca