Problems with making add-ins

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I've been searching for info on this all day now, and still can't get
anywhere. I'm building an access add-in for our customers which will
import and export them using a partially-propreitary format. I've
gotten the add-in to load in teh file-menu mode and can run it from the
add-in menu just fine, but I can't figure out how to run it from a code
block within the new database. I'd like to have it so a button could
be programmed to bring up the forms from the add-in. WHat I have so
far is this:

Private Sub Command0_Click()
Application.Run "[SDTAccessTransfer].[DataTransfer_Menu]"
End Sub

where SDTAccessTransfer is the name of the mde file and
DataTransfer_Menu is the name of a function which just runs an openform
in the mde.

WHen I try to run it I get

Run-time error 2517
Microsoft Office Acces can't find the procedure
'[SDTAccessXMLTransfer.'

Can someone help me figure out how to run the add-in from a form
button?

Thanks in advance,
 
I've never run code from an add in, (we use references) but
from what I remember it is no different from what you have,
except --

loose the square brackets [ ] -- they are not supposed to be there

The fully qualified path to a function is

projectName.moduleName.functionName,

but that does not work with Eval or Run. You have to use just the Function
Name

This does not work:
?application.Run
("ctm_bs_module.mdlrp_dllcheck.gfn_getversion","msaccess.exe")

This does:
?application.Run ("gfn_getversion","msaccess.exe")

(david)
 
There needs to be a global function or a form in the code mdb.

Docmd.OpenForm "formname"
or
FunctionName()
 
David-
I've tried it without the brackets and still recieved the same
problems...

Steve-
I'm not quite understanding what you're saying. I thought I couldn't
do an openform on an *.mde addin from an mdb. Is this wrong?
 
I haven't done a library call in years, but if you tried it and it failed
then the answer is... you're right. Otherwise, the form will open, and
you're golden. :D
 
Just to be clear, did you try it without the 'filename'?

What version of Access are you using?

Can you get it to work as a reference instead of as an Add-In?

(david)
 
Just to be clear, did you try it without the 'filename'?
Yes

What version of Access are you using?
2003

Can you get it to work as a reference instead of as an Add-In?
Yes

-Chris
 
Last time I did this was in A97. I'm sorry, but this
may take a couple of weeks before I will get the chance
to build an add-in to test in A2K3. I see to my chagrin
that today my A2K3 and A2K2 installations are broken as
well - I opened and cancelled the A2K installation wizard
and that must have damaged something.

(david)
 
FWIW, I just created and loaded an Access 2003 mde
as an add-in.

Starting the addin from Run, Eval, or a menu item
is utterly flaky, and completely unusable.


I can run the entry points like this:

application.run "gfnVN_VerNum"

AFTER THE MDE IS CORRECTLY LOADED.

This sequence works:
1 Call the entry point from the add-in menu
2 Call the entry point from the immediate window
3 repeat 1 until 2 works
4 Call the entry point with application.run

Calling directly from a custom menu item is even
less reliable.

Calling the entry point with application.run does
NOT load the add-in, and the call will fail if the
add-in is not already loaded.

BTW, I had a look at the built in menus, and this
section is specially coded. Unlike the standard menus,
which include placeholders for runtime values, the
add-in menu items are actually created at runtime.

(david)
 

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

Back
Top