dcsimg
Results 1 to 5 of 5

Thread: Manipulate Access form controls from VB6 Dll

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    54

    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.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    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.

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    54

    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..

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    54

    Re: Manipulate Access form controls from VB6 Dll

    Quote Originally Posted by LaVolpe View Post
    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
  •  



Featured


Click Here to Expand Forum to Full Width