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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Me.Name
Dg Ewing 
     
4 years ago
I close forms in a menu driven front end, so that the desktop window does not get cluttered.  I am trying to use the following so that I do not have to remember the form name and type it each time.  

   DoCmd.close , acForm , me.Name , acSaveYes

But me.Name does not work

any thoughts on what I am doing wrong
Kevin Robertson  @Reply  
           
4 years ago
You have one too many commas.

DoCmd.close  acForm , me.Name , acSaveYes
Dg Ewing OP  @Reply  
     
4 years ago
Sorry, Kevin,

I only had the extra , in my forum text.  This is a copy and paste version.  [I don't know why I use the passvalue technique??]

  Dim passvalue As String
    Dim strsearch As String
    
    passvalue = Me!MDKaID
    'DoCmd.Minimize
    DoCmd.Close acForm, Me.name, acSaveYes
    DoCmd.OpenForm "MDKA_Form", , , "MDKaID=" & passvalue
Dg Ewing OP  @Reply  
     
4 years ago
oh, maybe I should have said (recognized) that I am exciting the above code on a subform,,, would that matter?
Richard Rost  @Reply  
           
4 years ago
Open the 2nd form before closing the calling (1st) form.
Dg Ewing OP  @Reply  
     
4 years ago
If you meant reverse the two DoCmd's

DoCmd.Open
and then
DoCmd.Close

I tried that and still did not close the 1st form

the Mainform that is open that I want to close is MasterTab which has a subform that I am clicking on the MDKaID , and I want the mainform and its subforms to close before opening the MKDA_Form.  

if I substitute the the form name for me.Name it closes fine.
Kevin Robertson  @Reply  
           
4 years ago
If the code is being executed from a SubForm use Parent.Name instead of Me.Name
Richard Rost  @Reply  
           
4 years ago
Does it work if you put the actual name of the form in there?
Dg Ewing OP  @Reply  
     
4 years ago
Yes
Dg Ewing OP  @Reply  
     
4 years ago
Thanks Kevin,  

the Parent.Name is the ticket when closing from a subForm.  

It worked !!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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/7/2026 11:44:19 AM. PLT: 0s