Solved

Microsoft Access VBA Form can't load or unload this object

Posted on 2010-08-18
3
883 Views
Last Modified: 2013-11-28
Hi,

I have two forms. The a button on the main form is clicked which loads another form called frmDaily, which has 3 buttons on it. In the frmDaily object I have some code which contains the unload me statement, however the code debug here with "can't load or unload this object".

I do not understand why this is happening & I have never come across this before? Any help would be great!

Thanks

Mark
0
Comment
Question by:mcs26
3 Comments
 
LVL 2

Accepted Solution

by:
aamsoh earned 500 total points
ID: 33462654

Instead of Unload "form", what worked was:

DoCmd.Close acForm, "frmName"

With this usage, you do not need the Form_ prefix.

NOTE: DON'T FORGET TO CLICK "HELPFUL COMMENTS YES"
0
 

Author Closing Comment

by:mcs26
ID: 33462770
Thanks very much.

I normally use Unload Me without any trouble can you tell me why it would not work in this case?

Cheers
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 33463522
Unload works in VB, not Access VBA.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access - Undefined function 'Format' in expression. 14 44
Linking Master Child Fields 2 25
MS Access Query Question 2 34
Convert VBA UDF to SQl SERVER UDF 4 49
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question