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 
Returning Form names
Jerry Fowler 
       
3 years ago
I am creating a bug/New Feature form for my database. I have 3 users that access the Database. From there they can report bugs or request a new feature. I'm able to return the form name if it's the only form open, and also an active form name if I have 2 forms open.  From there I can't seem to get anything beyond the 2nd form. here is the cope that I'm using

Dim FormName As String
FormName = Application.ActiveControl.Parent.Name

Some of the other code I tried was

Dim FormName As String
FormName = Screen.ActiveForm.Name

From my MainMenuF I'll click on Membership and open the MembershipF, at this point I'm getting the correct form name. I will then open Email Address from the MembershipF and thats when I start only getting MembershipF returned from there on.

Thanks
Kevin Robertson  @Reply  
          
3 years ago
Where are you placing the code?
Where are you calling it from?
Jerry Fowler OP  @Reply  
       
3 years ago
the code is on the MainMenuF form and I'm using a button with a double click. I was trying not to have a button on every form as that would be quite an undertaking. That might be an issue but it is returning the form that is also called from the MainMenuF. I get MainMenuF if I click the button from MainMenuF. If I click to send an Email from the MainMenuF and it opens EmailF, then I click the bug button on MainMenuF I get EmailF return
Jerry Fowler OP  @Reply  
       
3 years ago
Kevin, I just tried changing it to a TempVars just for the heck of it.

Dim TempBugForm As TempVar
TempVars!TempBugForm = Application.ActiveControl.Parent.Name

Still same result if the open form count is greater than 2 I always get the form name of the 2nd open form.
Kevin Robertson  @Reply  
          
3 years ago
You could put the code in a Global Module and call the code as an Event Handler in the GotFocus() event for each form. See my screenshot for details.
Kevin Robertson  @Reply  
          
3 years ago

Jerry Fowler OP  @Reply  
       
3 years ago
Kevin, I'm giving your idea a try and the first 3 forms I added the function to recognized it, but then I had a few that didn't.  All in the same database. here are some shots to show
Jerry Fowler OP  @Reply  
       
3 years ago

Jerry Fowler OP  @Reply  
       
3 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 11:36:00 PM. PLT: 1s