Results 1 to 3 of 3
  1. #1
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40

    How to declare constant optional paramenters for function or sub

    Hello,



    I was trying to find a way to name constant optional parameters for a function. I have function A(optional myParameter as Integer) as Boolean.
    When i make a function call I want to be able to see predefined legit values for myParameter that my "function A" can accept. I would think it should be relatively easy to define but can't find a way to do so. Please help. Thanks

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,043
    You could try to declare an enum, and then use that:

    for instance

    Public Enum ImportFormat
    Unknown = 0
    FlatFile = 1
    Excel = 2
    XML = 3
    Access = 4
    End Enum

  3. #3
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40
    that's exactly what i was looking for, thanks a lot!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-09-2010, 04:19 PM
  2. Help with AVG function
    By techexpressinc in forum Reports
    Replies: 1
    Last Post: 03-23-2010, 07:47 AM
  3. Function Help
    By th3spankst3r in forum Programming
    Replies: 12
    Last Post: 03-22-2010, 12:41 PM
  4. Want function to get current function name
    By Davis DeBard in forum Programming
    Replies: 2
    Last Post: 08-13-2009, 05:02 AM
  5. Is there a function to do this....
    By Nowherefast in forum Access
    Replies: 2
    Last Post: 12-31-2008, 08:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums