1

I am working on several different access projects that share a lot of code. Right now what I do is importing modules, which is fine as long as I'm the only one working on it, but for the future I need a better solution (also better than password protection).

What would be the best way to share code? I have Visual Studio 2013 for that purpose. I have tried creating a dll and com objects, but I couldn't add the files as a reference to Access, I think maybe it's because it was .NET, I'm not really sure.

As you can see I am not familiar with this subject, and so any hints/links/buzz words would bee highly appreciated.

Thanks, Yotam

Yotam
  • 9,789
  • 13
  • 47
  • 68
  • Should be okay with a COM enabled .net dll and a good way to go. There are a few hoops to jump through. Perhaps this will help, it's for excel, but that shouldn't make a difference. http://richnewman.wordpress.com/2007/04/15/a-beginner%E2%80%99s-guide-to-calling-a-net-library-from-excel/ – Tony Hopkinson Oct 19 '13 at 10:38
  • version control with ms-access: check http://stackoverflow.com/questions/187506/how-do-you-use-version-control-with-access-development#188999 and http://stackoverflow.com/questions/187506/how-do-you-use-version-control-with-access-development#188999 – Philippe Grondier Oct 19 '13 at 21:37

3 Answers3

5

One way to share code among VBA projects is to store the common code in a separate .accdb file (say, "CommonCode.accdb") and then add a Reference to that file in the various VBA projects that will use those common procedures and functions.

To add such a reference you need to click the "Browse..." button in the References dialog and then choose "Microsoft Access Databases (*.accdb)" from the "Files of Type" drop-down:

BrowseReference.png

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
0

I believe that the best way to share a VBA code is not to let it readable, but compiled.

You can do this by creating an Access Runtime, .accdr.

jacouh
  • 8,473
  • 5
  • 32
  • 43
0

version control with ms-access: check here and there

well ... these are the links to my own answers to this question, but I do not mind if you check and prefer other's answers

Community
  • 1
  • 1
Philippe Grondier
  • 10,900
  • 3
  • 33
  • 72