So, I have a build written in C # using Visual Studio 2010.
This assembly contains one class that contains one method that returns the word Result, the code below:
using System.Runtime.InteropServices; namespace TestDLL { public class Class1 { [ComVisible(true)] public string TestMethod() { return "Result"; } } }
The output section on the Build tab in the properties window looks like this:
When I click Build, I get a DLL file and a TLB file. I can add this TLB file to Microsoft Access simply by viewing it.
Now in Access I have a button and a shortcut. I want to make the Caption property of my shortcut equal to the result of testMethod. I think I need to do something similar below, but I'm not sure any help would be much appreciated:
Private Sub btnMain_Click() Dim tm As TestDLL Dim foo As String foo = tm.testMethod lblBarr.Caption = foo End Sub
Thankyou
Jmk
source share