• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 971
  • Last Modified:

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

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
mcs26
Asked:
mcs26
1 Solution
 
Aamir SarfarazIT ManagerCommented:

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
 
mcs26Author Commented:
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
 
Dale FyeCommented:
Unload works in VB, not Access VBA.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now