Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Public Variables
Alan Hill 

13 years ago
Splash Screen displays when the DataBase is opened and closed no need to keep it open.
TempVar values are now in memory.
  
Private Sub Form_Open(Cancel As Integer)
Dim strPath As String
TempVars.Add "strDBTitle", "V1.15"
Me.Caption = "Welcome " & TempVars!strDBTitle
strPath = PathTxt
'Set up FolderPaths:
TempVars.Add "strFolder", strPath
TempVars.Add "strImages", strPath & "Images\"
TempVars.Add "strActors", strPath & "Actors\"
TempVars.Add "strPosters", strPath & "Posters\"
TempVars.Add "strHelp", strPath & "HelpImages\"
TempVars.Add "strCollage", strPath & "Images\Collages\"
TempVars.Add "strPP1", strPath & "Images\PersonalPics\"
TempVars.Add "strPP2", strPath & "Images\PersonalPics2\"
TempVars.Add "strDir", strPath & "Directors\"
End Sub

By way of an explanation I have 600 MB of pictures, of Actors Actresses and Movie Directors.
All saved in a folder/folders. If I give a copy of my database to someone else They can put the folder anywhere.
Copy the path to a table and it all works fine.  
PathTxt is a TextBox which uses dlookup to find the folder path.

Using TempVar - To use TempVar notice the bang (!) symbol
On A Different Form.
PosterFrame.Picture = TempVars!strPosters & Title & ".jpg"
The current record textbox [Title] is updated and a new picture is displayed
On another form.
ImageFrame.Picture = TempVars!strActors & Actor & ".jpg"
The current record textbox [Actor] is updated and a new picture is displayed

As I make changes to my Database I create a new version edit TempVars.Add "strDBTitle", "V1.15"
and all my forms reflect the current version. I just have to make one change. Once.

Another reason to use TempVar - They can be used in queries. That could make your life easier.
  
I will mention I have never used Access for business purposes. I do however enjoy playing with it enormously.
Google TempVar for more information. I hope you find this useful.


Reply from Richard Rost:

Yep. I used to do something similar with my databases, but I'd store the values in a table and then TempVar them when the database started up to make things run faster... prevents constant DLOOKUP calls for things that don't change often.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/17/2026 10:17:33 AM. PLT: 1s