MS Access - VBA - Using global Var in query

Posted on 2012-08-22
Medium Priority
Last Modified: 2012-08-24
Access 07

I've got some vba code that processes some data.  During that processing I capture a global variable.  Is there a way (NOT IN VBA) to use that variable in a query?
Question by:keschuster
  • 4
LVL 75
ID: 38322750
1) You can call a Function that grabs the value or - but that is VBA. Soooo

No, unless ... you are in A2010, and you use the TempVar() collection ...

LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 38322753
I guess A2007 also has TempVars() also ... which are essentially ... Global Variables that do not get reset if there is an error or reset ...


Author Comment

ID: 38322754
thats what I thought...  ty
LVL 75
ID: 38322778
Overall, TempVar() are a pretty cool, long overdue feature ...


Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

750 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