From: x203@optusnet.com.au   
      
   "Ralph" wrote in message   
   news:pOednR0nI9CPp5XYnZ2dnUVZ_rWdnZ2d@arkansas.net...   
   >   
   > "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   
   >   
   tya, I appreciate your responses. Although I understand the   
   replies, I'm struggling with the code to achieve it & I'm   
   hoping that someone can be a bit more specific.   
      
   I can't publish details of the application as it's semi-cic   
   however I can liken it to a quiz. One question on each of 3   
   forms using option buttons. I need an answer from form 1   
   passed to form 2, both answers from forms 1 & 2 passed to   
   form 3.   
      
   My current approach is to write the answers to a temp file   
   which apart from passing the variables, it makes it easy to   
   reset the application.   
      
   Is there a better way of doing it? A response of more than   
   'yes' would be appreciated.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|