Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-08-18
3
Medium Priority
?
943 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:
Aamir Sarfaraz earned 2000 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
ID: 33463522
Unload works in VB, not Access VBA.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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