[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Multi-Form Variable

I have a testing program with mutiple Forms and I want to use a variable to record what the tester receves as a score. For example,  in the begining of the program, A = 50. If the tester gets one wrong, A = A - 1. The problem is that A will not retain its value form to form.  I know now that I must put the variable in a Module. I have never used a Module before. How do I do This?
0
R_N_WARD
Asked:
R_N_WARD
  • 5
  • 3
1 Solution
 
MarineCommented:
You can place the variable into a Module(.bas) file. With scope Public It will retain the value on all for all project
0
 
R_N_WARDAuthor Commented:
Say What?!
0
 
R_N_WARDAuthor Commented:
I have never used a Module before. Could you guide me through it?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
R_N_WARDAuthor Commented:
I have never used a Module before. Could you guide me through it?
0
 
Gotcha007Commented:
go to the menu project and choose "add a module"
in this new module, add this line :
global xxx as integer
where xxx is your variable name.

this variable will be accessible on all the project and it will retain his value.


0
 
R_N_WARDAuthor Commented:
Edited text of question.
0
 
R_N_WARDAuthor Commented:
Works Like a charm, Gotcha007. Thank you.
0
 
MarineCommented:
It doesn't have to be a module it can be your standard form. Just in General Declaration place Public x as Integer or in Module Place Public x as Integer.
You can use this variable then thoughout your code.
0
 
MarineCommented:
Global was used previously and only is there for backward compability you shoulduse Public scope variables
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now