Hi. I have the below code in a secondary form in a VB game I'm working on (in VB 6.0).
'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'.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
I hope that's clear enough, but ask for elaboration and I'll explain further. Thanks in advance for an help.![]()




Reply With Quote