Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    drop down list on parameter of function (A97)

    I have a public function defined in a module like this:

    public Function fnMyFunction(mIntParam as Integer) as Boolean
    ....
    end Function

    If you use standard functions and/or methods often a drop down list appears with the available options for a parameter.
    How can I implement a drop down box like that for one of my own functions (like the above)?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: drop down list on parameter of function (A97)

    Hello Bart,

    I don't think this is possible in Access 97.

    In VB6, you can define your own list of constants:

    Public Enum InterfaceColors
    icMistyRose = &HE1E4FF
    icSlateGray = &H908070
    icDodgerBlue = &HFF901E
    icDeepSkyBlue = &HFFBF00
    icSpringGreen = &H7FFF00
    icForestGreen = &H228B22
    icGoldenrod = &H20A5DA
    icFirebrick = &H2222B2
    End Enum

    and then have a routine

    Public Function fnMyFunction(icColor as InterfaceColors).

    I don't know if this works in Access 2000 or XP. It doesn't in Access 97.

    In your example, the parameter is defined as Integer. In that case, the program has no way of knowing which values are permitted. A dropdown list with all integers is a bit much, don't you think?

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: drop down list on parameter of function (A97)

    Hans, Bart,

    This is working in Access 2000
    Francois

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: drop down list on parameter of function (A97)

    Hello Francois,

    That's nice to know. Thanks for trying it out.

    Regards,
    Hans

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

    Re: drop down list on parameter of function (A97)

    Enums were introduced in Access 2000. They weren't supported in Access 97.
    Charlotte

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: drop down list on parameter of function (A97)

    Thanks,

    Now I understand why I couldn't figure out how to do it in A97.

Posting Permissions

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