Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ActiveX control fill combobox? (A2K sr1)

    I have added an activeX control to a form. I

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

    Re: ActiveX control fill combobox? (A2K sr1)

    Since GetInstalledMapsCombo is described as a method, I'm not sure how you would call it. You may be able to set the rowsource by using something like ActiveXCtl0.RowSource = GetInstalledMapsCombo(ActiveXCtl0.hWnd), where ActiveXCtl0.hWnd represents the hWnd of the control.

    It looks like GetInstalledMapsCombo is a callback into the dll that supports the ActiveX control and you will need the hWnd of the combobox as an argument. In VB, that's easily done, but in Access it's not as straightforward. Since the control is a custom control, though, it may *have* an hWnd property, so try looking for it.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActiveX control fill combobox? (A2K sr1)

    Thanks for your reply Charlotte. I suspect you

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

    Re: ActiveX control fill combobox? (A2K sr1)

    Why are you using Let? It isn't required and just confuses the issue.

    GetInstalledMapsCombo is apparently a method of the control, not a function. The first way you tried to use it, the system was looking for a function with that name and not finding it.

    The hWind (if the syntax checker capitalizes the H, it means that autocorrect is on and it doesn't recognize the word) is the window handle for a particular object. It's a Long in the 32-bit version of Windows (can't remember whether it was different in 16-bit), and you will have to use code to return it if the control itself doesn't expose its hWnd. In VB, controls expose their hWnd but not in Access.

    In Access, you can get the hWnd of the active form like this:

    intWindowHandle = Screen.ActiveForm.hWnd

    You can use an API call, such as in this code from <A target="_blank" HREF=http://www.mvps.org/access/api/api0027.htm>The Access Web</A>, to return the hWnd of an individual Access control.

    You don't normally populate a control like that using a callback, and I'm not at all sure you'll be able to populate 2 columns, since I'm not familiar with the control. In a normal combobox, you simply put the name of the callback in the RowSource property.
    Charlotte

Posting Permissions

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