Executing a module from another DB

  • Thread starter Thread starter bah
  • Start date Start date
B

bah

Guest
I am in database A and need to run a standard module that is in database B in the background from database A.

What is the VB code to run a module from a different database? I know how to open the module using the following code - is there a way to change the syntax so that it points to this module in a different database?

DoCmd.OpenModule "modules_excel_input_files"
 
You cannot open a module that is in database B from within database A. You will have to copy the module from B to A then run the needed procedure from A as any other local procedure.

Darrin@CB69
 
Hi All

I have been using the site for a while now but just joined up so i can post for some help :).
I have done a couple of days training on access but only been using it for just under a year so still fairly new to it.

I know this is a very old post but it was actually relevant and useful for something i'm doing in access 2010.

I was able to use this post to reference another db and call a sub but i am having an issue when i try to reference my menu form in the code.

So my code in one db opens another db then i am trying to call a sub that will hide buttons depending on who has opened the db. The sub is called fine but its when i reference my form it says it can't find it.

The forms is open and the code works when i run from the db that it is located in. I tried setting visible property from the both and it cant seem to find it.

My code is just a list like below.

Any idea why this isn't working? do i need to reference the db before the form?

Forms![Menu]![Command0].Visible = True
Forms![Menu]![Command2].Visible = True
Forms![Menu]![Command3].Visible = True

Thanks
G
 
Hi Jiri

Thanks that works great, i was just using call sub before which wasn't working

GMc
 
@Solo - make sure you check the date of the post- Darrin has probably retired by now.... :D
 

Users who are viewing this thread

Back
Top Bottom