Results 1 to 6 of 6

Thread: Referring to variable on different form, same project

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    2

    Resolved Referring to variable on different form, same project

    Hi. I have the below code in a secondary form in a VB game I'm working on (in VB 6.0).

    Code:
    Private Sub Command3_Click()
            If (Command3.Caption = "Continue") Then
            beerscore = (Start.scoretotal + drink)
                    Start.lblScore.Caption = "hello"
                    Start.scoretotal = Start.scoretotal + drink
                    MsgBox "Your points have been deposited into your score."
            End If
            Beergame.Visible = False
            Start.Visible = True
    End Sub
    'scoretotal' is a value on the first form. Am I referring to it correctly in this code? I'm attempting to add the value 'drink' from the current form to 'scoretotal' in the first form, and post that number in 'Start.lblScore' (a lable). The first form is called 'Start'. The one this code is on is called 'beergame'.

    I hope that's clear enough, but ask for elaboration and I'll explain further. Thanks in advance for an help.
    Last edited by Isolated; Jun 3rd, 2005 at 07:26 PM.

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