Is that your actual code? The reason I ask is that I can not see any way in
which that code would compile, let alone run, in VBA code behind an Access
form.
There's no function named 'Form' in Access or VBA, and to pass the name of a
form or other object to a function it would need to be enclosed in quotes.
To close an Access form, use the DoCmd.Close method. I suspect your code may
be adapted from an example intended for other VBA-enabled applications such
as Word or Excel. Access forms are very different from the UserForms used by
those applications.
--
Brendan Reynolds
Access MVP
"Stuart Grant" <sagranatbluewin.ch> wrote in message
news:%(E-Mail Removed)...
>I have a small form Exchange Rates on which I enter the current exchange
>rates for two or more currencies.
>
> It has two buttons Next and Finish
>
> When I click Next it moves to the next record but when I click Finish I
> get the error message "Can't load or unload this object". The code for
> the On Click Event is
> DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
> Unload Form(Exchange Rates)
>
> Why?
>
> Stuart
>
>
|