Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VB Forms in Access (VB / Access 97)

    I've written a DLL which allows users to specifiy an Access table and transfer the contents to an AS/400 system. The DLL has a form which is a progress meter & is displayed during the different stages of the DLL transfer.

    The form is displayed fine when I test from my VB6 environment, everything works how it's supposed to. However, when I use the same bit of code in Access 97 the progress form isn't displayed.

    Any ideas on this one? I know you can use DLL forms in Access as I tested another DLL that does some DB sign on stuff, the only difference there is that the form is displayed modally.

    I'm using a function to set the window on top as it is created...

    Public Sub SetWindowOnTop(ByVal lhwnd As Long, Optional ByVal optvbTop As Boolean = True)

    Dim iTopMost As Integer

    iTopMost = IIf(optvbTop, HWND_TOP, HWND_NO_TOPMOST)
    SetWindowPos lhwnd, iTopMost, 0, 0, 0, 0, NOMOVE Or NOSIZE

    End Sub

    This should put the window into focus if it has displayed the form shouldn't it? Can't figure it out....!

    Thanks

  2. #2
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Forms in Access (VB / Access 97)

    Access deals with child windows in a very strange way. Dialog windows actually show up as normal Windows windows. They have hwnds, and you can see all of the controls on the window as child windows. Access forms on the other hand, only show the currently active control as a separate child window. Everything else shows up as just the window of the form. It's really odd.

    Anywho... I am attaching a zip file with a little .exe I wrote up in VB. It will display every window on your machine. (It's a treeview, child windows are child nodes...). Use to to find your window. It is probably opening, but it may not be visible. (My form does let you switch a window to visible or hidden.)
    Attached Files Attached Files

  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Forms in Access (VB / Access 97)

    Thanks for the reply, tried this out with my DLL but couldn't find the window - it just doesn't seem to be displaying in Access! Very strange, as all the code is running fine & it's doing what it's supposed to, you just can't see the progress meter.

    Thanks anyway

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: VB Forms in Access (VB / Access 97)

    It really isn't necessary to open an Access database (in Access) to do this sort of thing. A VB app should work just fine, as it can work with Access tables - that way your progress bar should be visible.
    Wendell

  5. #5
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Forms in Access (VB / Access 97)

    The DLL is a generic 'Transfer' utility , I want standard Access VBA'ers to be able to use this DLL from within their Access databases. Only a couple of users have full VB.

    Thanks

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: VB Forms in Access (VB / Access 97)

    They shouldn't need full VB to run a VB app - just the runtime. Trying to run VB DLLs inside of Access and make the forms behave is a major challenge as Access forms and VB forms work entirely different. Just out of curiosity, why did you write the package as a DLL instead of simply doing it in VBA?
    Wendell

  7. #7
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Forms in Access (VB / Access 97)

    Becuase I'm using enumerations & events that simply aren't available in VBA. I'm using low-level IBM Client Access code, you can't do it in VBA (office 97)

    Maybe I'll change it into an EXE so it runs in it's own process.....that should sort it out.

    Thanks anyway.

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VB Forms in Access (VB / Access 97)

    Are you stuck with A97? Later versions do support Enums, among other things.
    Charlotte

  9. #9
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Forms in Access (VB / Access 97)

    For the meantime, yes - & maybe in about 6 years time we'll upgrade to Office XP...!! But good to know enums are supported in later versions...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •