Problem with two forms

Thread Solved

Join Date: Jun 2007
Posts: 50
Reputation: Prozeen is an unknown quantity at this point 
Solved Threads: 4
Prozeen's Avatar
Prozeen Prozeen is offline Offline
Junior Poster in Training

Problem with two forms

 
0
  #1
Aug 20th, 2007
Hi there.

I've got two forms (form1.frm and frmoptions.frm.) The first form contains a variable (multip = 2.) When I click on the first form let's say I want to see that variable in the second form's command button's caption. This doesn't work. All I get is a blank command button (without the variable as the caption.)

I've declared the variable as 'Public' in the General / Declarations section (in the first form.) And I use the code below to see the second form...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. frmoptions.Show
  2. frmoptions.SetFocus
Any suggestions? Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 193
Reputation: plusplus is an unknown quantity at this point 
Solved Threads: 16
plusplus plusplus is online now Online
Junior Poster

Re: Problem with two forms

 
0
  #2
Aug 20th, 2007
in load event of frmoptions have
commandbuttonname.caption = Form1.multip
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 50
Reputation: Prozeen is an unknown quantity at this point 
Solved Threads: 4
Prozeen's Avatar
Prozeen Prozeen is offline Offline
Junior Poster in Training

Re: Problem with two forms

 
0
  #3
Aug 20th, 2007
Thanks plusplus.

I didn't think to use the "form1" part of the code, because I thought this would be automatically known by vb due to the fact that it is a Public variable.

Nice one, thanks
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 1011 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC