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
Solved

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

Posted on 2010-08-18
3
876 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

808 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