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 
Filling and Referring to Forms
Garry Smith 
    
4 years ago
What pit falls to you see when loading a Tempvar in the OnCurrent event with the ID field data instead of referring back to another forms ID field with [Forms]![SomeFormName].[ID]?
I have been using this method which allows me to use the Tempvar as a default value for new record and for SQL statement and queries. This allows my forms to be used with universally instead of creating multiple forms.
Richard Rost  @Reply  
          
4 years ago
Sounds like a good idea. In fact, I used to do something similar with a TempVar for the form that OPENED the current form. This way if you need an ID from that form, and the user closes it, you've still got it. Say the CustomerF is opening the OrderF. When you open, set the Var so you know which form you came from and can go back there if you need to.
Garry Smith OP  @Reply  
    
4 years ago
I have done the same.
As long as there is a system to the madness of tracking Tempvars I find them valuable for creating less objects such as Forms and parameters in queries.
Garry Smith OP  @Reply  
    
4 years ago
Do you have a video that shows how to use a variable in place of a main form name when referring to components on the main form from a subform to make the subform which would enable subforms that can be used on more than just one master form?
I have tried using Parent but cannot get this work.
Richard Rost  @Reply  
          
4 years ago
Parent should work just fine. This will give you the parent's name:

MsgBox Me.Parent.Name

If you put this on the Order Detail Subform, it should give you the OrderID on the parent Order Form:

MsgBox Me.Parent!OrderID
Garry Smith OP  @Reply  
    
4 years ago
Thank you Richard
Richard Rost  @Reply  
          
4 years ago
You're very welcome. :)

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/6/2026 3:52:36 PM. PLT: 1s