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 
Calling Form
John Davy 
         
5 years ago
Hi Rick

I have a form that can be opened from 2 different buttons. If it is opened from Button A then when I close it I want to open my Mainmenu. If it opened from Button B then I do not want to open my MainMenu. I have seen vba where do that but don't know where I saw it. If you can point me in the right direction I am all ears.
Thanks
John Davy
Alex Hedley  @Reply  
           
5 years ago
Sure ABCD has this concept where you store the calling form in a hidden field and use that when you close
Adam Schwanz  @Reply  
           
5 years ago
You should be able to do this with just a hidden text box on your form I would think. When button A is pushed set the field to X or whatever, when button B is pushed dont set it. Then on close do an if/then to check if the field is X or empty and either open the main menu or dont.
Adam Schwanz  @Reply  
           
5 years ago
Same thing Alex said, I guess I should refresh these sometimes before I leave and come back later to answer haha.
Richard Rost  @Reply  
          
5 years ago
You could do it with a little TempVars action:

Button A:
TempVars("WhichButton")="A"
Docmd.OpenForm "WhateverF"


ButtonB:
TempVars("WhichButton")="B"
Docmd.OpenForm "WhateverF"


Now in the OnClose event for the WhateverF just read in that TempVar and act accordingly.
Adam Schwanz  @Reply  
           
5 years ago
We need a TempVars techhelp Richard :P
Richard Rost  @Reply  
          
5 years ago
And if anything, I'm the one who's all ears...
Richard Rost  @Reply  
          
5 years ago

Richard Rost  @Reply  
          
5 years ago
Yeah, I really haven't OFFICIALLY covered TempVars yet. I will soon.
Scott Axton  @Reply  
        
5 years ago
Q  -  What are you doin' with all that extra time any way???
Richard Rost  @Reply  
          
5 years ago
Extra time? Me? Ha ha ha.
Dan Jackson  @Reply  
            
4 years ago

Scott Axton  @Reply  
        
4 years ago

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 7:54:43 PM. PLT: 0s