-
Feb 29th, 2012, 11:26 AM
#1
Thread Starter
Member
Manipulate Access form controls from VB6 Dll
Hello to everybody
I have a thought of transferring some of my Access functions/subs to an external Dll
I did some tests but i stumbled on a critical issue
How to manipulate a control's attribute for example .Enabled
I can easily get a reference to a form's controls,count them,get their name but i cannot find any way to "change" them.
Maybe you are thinking why anyone would like to do something like that....
Well the answer is simple ...about 175,000 lines of spagheti code with "duplicate" functions spreaded on around 10+ programs....something u so in one mdb should be copied/replicated to to the other ....too much work.
Thanks in advance
P.S any other handy code i could use i very much welcomed.
-
Feb 29th, 2012, 02:49 PM
#2
Re: Manipulate Access form controls from VB6 Dll
With VB6, the trick was to pass the DLL an instance of the VB.Global object & that object contains the forms collection, among other stuff. With that forms collection, one can then access the controls on a specific form
VBA seems to have a similar Global object named: VBA.Global
Worth a shot, here's more info on the technique. Sample cannot be used directly as-is.
-
Feb 29th, 2012, 02:49 PM
#3
Re: Manipulate Access form controls from VB6 Dll
If you are thinking of doing this sort of change (major change as I see it) then why not build front end in VB and let it manipulate database?
Whether you choose VB6 or VB2010 isn't relevant but my choice would be VB2010.
-
Feb 29th, 2012, 03:24 PM
#4
Thread Starter
Member
Re: Manipulate Access form controls from VB6 Dll
Right now i am thinking this Dll in order to clean up some of the code... i am sure i have to jump to the .NET wagon but my time is way limitted..
-
Feb 29th, 2012, 03:26 PM
#5
Thread Starter
Member
Re: Manipulate Access form controls from VB6 Dll
 Originally Posted by LaVolpe
With VB6, the trick was to pass the DLL an instance of the VB.Global object & that object contains the forms collection, among other stuff. With that forms collection, one can then access the controls on a specific form
VBA seems to have a similar Global object named: VBA.Global
Worth a shot, here's more info on the technique. Sample cannot be used directly as-is.
I am admit this is way to "different" ...i can't find the suitable word.
DO you have by any chance a small demo...or what...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|