Thank you both for your help. Unfortunatly though I am still getting the same error. It appears to be related to the fact that I am creating a new instance of the report object.
I have created a very simple test.
I have a form with a single button and the following code (g_bTest is declared...
In Access 2002 I am creating a new instance of a report object from a form using:
Dim rpt As New Report_rpt
Set rpt = New Report_rpt
I am then trying to set the GroupLevel ControlSource of the report in the Report_Open section using:
Me.GroupLevel(0).ControlSource = "Test"
and am getting...
Thanks vbaInet - that works perfectly. I didn't know about the VBA extensibility library. Looks quite cool. Powerful stuff! Do you know of any further documentation on the library?
Thanks as well Bob.
Re: Insert a module via VBA code
DCrake,
I can assure I am not doing anything illegal and nor am I breaking copyright. These are mdbs created by the company I work for. Most of these applications have a global variable all called the same name which is "VersionNo" which is a variable used to...
Re: Insert a module via VBA code
Thank you for your suggestion. I actually tried this and it did work although additionally I have to ensure that the module is not a form module as if it is you are not able to access the function.
I was just hoping that there was a way to add a module as I...
Re: Insert a module via VBA code
I am trying to read the value of a global variable in a separate access application. I had the thought that if I create a module within the separate application I could add a function to it using "Module.InsertLines" and then using "eval", I could read the value...
I am not sure what exactly a TempVar is so thanks for that I shall do some research.
I am unable to change the code within as the code I am writing is auditing software to audit several 100 databases. Hence no ability to change code.
James
Insert a module via VBA code
Does anyone know how to insert a module via VBA code into another application via automation. I do not want to import a module.
I would like to do something like below. However the line "dbs.Modules.Add("MyNewModule") is not correct and will not compile. I have...
Does anyone know how to get the value of a global variable in another Access application using automation (or any other way)?
I am unable to change any of the code in the application that is being referenced by automation.
Thanks for your help.
James