Solved

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

Posted on 2010-08-18
3
903 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 48

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

688 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