Advertisement

02.29.2004 at 01:33AM PST, ID: 20901646
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

VBA Global Variables

Asked by Zaehlas in Microsoft Access Database

Tags: , ,

This should be easy.  I'm trying to declare several global variables that will be available to every form in my database.   After searching the internet, and through trial and error, I am pretty sure that I need to declare the variables as Public in the General section of a Module.  I created a new module called Global Settings, and put my declarations in there:

Public gCurrent_Marshal As String
Public gCurrent_Marshal_ID As String
Public Const gChapter_Name As String = "ULTRA National"
Public Const gChapter_ID As String = "00"

However, when I try to read these variables, or change them using my forms, my forms act as though they do not exist.  I have several text controls on my forms that instead of showing the value, they show #Name?

I know some other resources have said to make sure you are not declaring a module level or procedure level variable with the same name, and I have confirmed that I have NO other Dim, Public, or Private commands referencing these variables.

I have a Main Menu form that should display the values of gCurrent_Marshal and gChapter_Name.  I have a Choose User form that references a table that has a list of user names and user id's that I use a List Box, unbound, and then set the following code for when they double click on a user name in the list box:

Private Sub lstChooseUser_AfterUpdate()

    gCurrent_Marshal = Me.lstChooseUser.Column(0)
    gCurrent_Marshal_ID = Me.lstChooseUser.Column(1)

End Sub

The same form also has text boxes to report the values of gCurrent_Marshal and gCurrent_Marshal_ID.  

None of these controls work unless I declare the variables inside the general section of the form itself...  but then it erases the variables, and they won't work *outside* the form.

What am I doing wrong?   Do I have to have the forms reference the module in some way?   Force the module to load?

"Z"Start Free Trial
[+][-]02.29.2004 at 01:46AM PST, ID: 10479446

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: vba, global, variable
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 5
Solution Grade: A
 
 
[+][-]02.29.2004 at 02:00AM PST, ID: 10479466

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:16AM PST, ID: 10479508

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:20AM PST, ID: 10479523

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:21AM PST, ID: 10479526

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:24AM PST, ID: 10479530

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:39AM PST, ID: 10479570

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:47AM PST, ID: 10479594

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.29.2004 at 02:54AM PST, ID: 10479611

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2004 at 02:02PM PDT, ID: 11629581

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2004 at 02:03PM PDT, ID: 11629586

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.27.2005 at 06:29AM PST, ID: 13152485

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.27.2005 at 06:31AM PST, ID: 13152502

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32