Results 1 to 7 of 7

Thread: [RESOLVED] Carrying Information Over From Form To Form

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Resolved [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.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: [RESOLVED] Carrying Information Over From Form To Form

    Thanks! It works perfectly!

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    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?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: [RESOLVED] Carrying Information Over From Form To Form

    ^ Never mind, I figured out the problem myself.

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    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.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2008
    Location
    St. John's, Newfoundland, Canada
    Posts
    965

    Re: [RESOLVED] Carrying Information Over From Form To Form

    No problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width