Access Parameters Using TempVars

Access TempVars are like using query parameters.

TempVars seem to be like Session variables for your Access application.

In the past I was using hidden forms to store parameters for my queries, but
TempVars can be useful to do the same thing. I have seen this in use and wanted
to share it with you.

TempVars.Add “LoginID”, 0

TempVars![LoginID] = [Form value]

intLoginID = TempVars!LoginID

If you want to destroy the Tempvar when closing the form or database you
can use TempVars.Remove “LoginID”

Watch it in the video:

You can download the database here:

Click here for the database and the code:
TempVars.accdb

If you have a suggestion for a future video, contact me on my contact form, and I will seriously consider it.




By the way, if you got or are getting value from the VBA information, please give me a tip, thanks!


These posts may help answer your question too...

How To Escape Apostrophe In SQL Update Query

If you are looping a table with thousands of records, you’ll probably run into at least one that has an apostrophe in the field name. Like “Mike’s” or “M’cormick”, or something else. Anyway, here is one way to escape the string when you are doing your update query. Option Compare Database Sub YDriveLoop() ‘4/23/24 erik@loeblcomservices.com […]

How To Parse A Flat File In Excel VBA

In another post I demonstrated how to access a file on your computer using the MS Office Library. Here it is if you don’t know what I’m talking about. In this post, I am going to show you how to access the file and load it into your spreadsheet. I will do the same thing […]

How can I interact with other Office applications (Excel) using VBA in Access?

Need to write your Access data or query to an Excel file? Here is the how to do it: Most people are familiar with Excel and know how to use it well (enough), and when you start talking about Access, they get scared off, and don’t know what to do anymore. Well, here you are […]

How To Create A Parameter Query In Access

A parameter query changes your ordinary static access query to be more dynamic and interactive. It will ask you a question about what you want to search for, allowing you to do a search query multiple times instead of just once. You can do your parameter query straight from the QBE (Query By Example) Editor, […]

Previous Post

Create A Report Based On Items Selected In Access Combo Box

Next Post

Access 2010 Ignoring Open Of ADP File