Access add-in unload

B

brett

I've created an Access add-in that creates a command button and is
supposed to show the name of the current database in a text box (to
make sure I can do it).

No problems with creating the command buttons, and the application
object is of type Access.Application - the application object is cast
as applicationObject = (Access.Application)application;

The code below works ok, but once run, Access refuses to unload. The
add-in unloads ok (the buttons are gone), but Access keeps popping up
and has to be killed from the task manager.

private void MyButton_Click(CommandBarButton cmdBarbutton,ref bool
cancel)
{
string msg = applicationObject.CurrentDb().Name.ToString();
System.Windows.Forms.MessageBox.Show(msg);
}

Anyone have any ideas what I'm missing?

thanks

Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top