Global Variables

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 200178 Views - Last Post: 25 August 2007 - 09:53 PM Rate Topic: -----

#16 zakary   User is offline

  • D.I.C Regular
  • member icon

Reputation: 27
  • View blog
  • Posts: 427
  • Joined: 15-February 05

Re: Global Variables

Posted 21 February 2005 - 09:29 AM

Thanks guys the private num As Integer = 0 works the way I wanted it

Thanks agian :D

This post has been edited by zakary: 03 March 2005 - 12:15 PM

Was This Post Helpful? 0
  • +
  • -

#17 Roa_09   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 25-August 07

Re: Global Variables

Posted 25 August 2007 - 09:38 PM

View PostBlackJesus, on 19 Feb, 2005 - 01:01 PM, said:

well he could set the value when the form loads...i dont know a lot about modules, but couldnt you declare it somewhere in there? what else is you program supposed to do besides count the number of clicks? >_<


i have a problem regarding th eprogram im doing..
i have 5 forms of question
and 1 form of the result

code:
_Form1 sub Load()_

Opiton Explicit
Public A as Integer

_btn2 click()_

A = A+0
(+0 kc mali ung sagot na yan kya as is lng..)

Dim I as Integer

I = MsgBox ("Sure kng?", vbYesNo or vbQuestion)

If I = vbYes

Form2.show
Form1.hide

ElseIf I = vbNo

Form1.show

End If

End Sub

_btn 1 click_

A = A+1
(+1 because this buton carries the correct answer)

Dim I as Integer

I = MsgBox ("Sure kng?", vbYesNo or vbQuestion)

If I = vbYes

Form2.show
Form1.hide

ElseIf I = vbNo

Form1.show

End If

End Sub

_Private sub_load_

A = +0
(because this is not the correct button of answer)


this the form 6 for the result:

_form6 sub_load()_
(this form contains 1txtbox and a button)

Optin Explicit
Public A as Integer

_btn1Result click_

text1.text = Form1.A + Form2.A --etc..

my problem is every time i click the btnResult it gets the value of all A in all 5 forms,.

how can i get the value of A that ic click?
Was This Post Helpful? 0
  • +
  • -

#18 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Global Variables

Posted 25 August 2007 - 09:53 PM

View PostRoa_09, on 25 Aug, 2007 - 09:38 PM, said:

my problem is every time i click the btnResult it gets the value of all A in all 5 forms,.

how can i get the value of A that ic click?


Before I offer any help you need to put that code into code blocks (the button with the # in the toolbar).

This post has been edited by PsychoCoder: 25 August 2007 - 09:53 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2