[RESOLVED] Carrying Information Over From Form To Form
I do have a question to ask regarding the carry-over of information from one form to the next.
If I were to use two forms, say Form1 and Form2, and Form1 originally displays default information in a Label box (as "0"), and then just before Form1 turns to Form2, the Label box turns from "0" to "1", and the "1" should be carried over to the next form. What would I have to do in order to have such successful carry-over?
BTW, this carry-over relates to a scoring system for the Card Sharks game I am currently developing.
Re: Carrying Information Over From Form To Form
If you want to set the value of a control on another form, use the name of the form as well as the control, eg:
Code:
Form2.lblScore.Caption = lblScore.Caption
Re: [RESOLVED] Carrying Information Over From Form To Form
Thanks! It works perfectly!
Re: [RESOLVED] Carrying Information Over From Form To Form
Got one problem as I attempted this carryover of label information from Round1k to Round2j:
Code:
Private Sub NextForm()
Round2j.Show
Round1k.Hide
Round2j.RWin.Caption = RWin.Caption
Round2j.BWin.Caption = BWin.Caption
Round2j.CurQues.Caption = CurQues.Caption
For i = 0 To 1
Round2j.lblRName(i).Caption = lblRName(i).Caption
Round2j.lblBName(i).Caption = lblBName(i).Caption
Round2j.lblRNameBar.Caption = lblRNameBar.Caption
Round2j.lblBNameBar.Caption = lblBNameBar.Caption
Round2j.RScore(i).Caption = RScore(i).Caption
Round2j.BScore(i).Caption = BScore(i).Caption
Next
End Sub
The information in those captions will not carry over for some strange reason. What would I have to do to allow for a smooth carryover?
Re: [RESOLVED] Carrying Information Over From Form To Form
^ Never mind, I figured out the problem myself. :)
Re: [RESOLVED] Carrying Information Over From Form To Form
Jon as I've mentioned before, you really shouldn't use labels to carry program information. The way to carry such program information is to create a Public variable in your GameEssentials6 code module and use that instead. There are no advantages to using labels.
Re: [RESOLVED] Carrying Information Over From Form To Form