Solved

Multi-Form Variable

Posted on 2000-04-11
9
190 Views
Last Modified: 2010-05-02
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
Comment
Question by:R_N_WARD
  • 5
  • 3
9 Comments
 
LVL 6

Expert Comment

by:Marine
Comment Utility
You can place the variable into a Module(.bas) file. With scope Public It will retain the value on all for all project
0
 

Author Comment

by:R_N_WARD
Comment Utility
Say What?!
0
 

Author Comment

by:R_N_WARD
Comment Utility
I have never used a Module before. Could you guide me through it?
0
 

Author Comment

by:R_N_WARD
Comment Utility
I have never used a Module before. Could you guide me through it?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Accepted Solution

by:
Gotcha007 earned 25 total points
Comment Utility
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
 

Author Comment

by:R_N_WARD
Comment Utility
Edited text of question.
0
 

Author Comment

by:R_N_WARD
Comment Utility
Works Like a charm, Gotcha007. Thank you.
0
 
LVL 6

Expert Comment

by:Marine
Comment Utility
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
 
LVL 6

Expert Comment

by:Marine
Comment Utility
Global was used previously and only is there for backward compability you shoulduse Public scope variables
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now