Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Enum in Access (Access XP)

    I declared this in the public section of a module:

    Public Enum tblProc
    cmTableName
    cmStart
    cmEnd
    End Enum

    Public Enum tblMSTR
    cmTermID
    cmevent
    cmEventTime
    End Enum

    When I run a subroutine using these vars in the same module it says the value is empty. Can I not use these in this way?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Enum in Access (Access XP)

    Hi Mike,
    I can't see anything wrong with that. What's the code in your subroutine?
    Regards,
    Rory

    Microsoft MVP - Excel

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

    Re: Enum in Access (Access XP)

    I'm not sure how you're trying to use Enums, but you have set set a value for them to use them in intellisense in Access 2k. Here's an example:

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


    The you use it like this:

    <pre>Public Function GetIColor(ByVal IC As InterfaceColors)</pre>


    When you type the GetIColor function into code, itellisense will offer a dropdown based on the Enum.

    How are you trying to use them?

    Edited shortly thereafter by Charlotte:

    I forgot about the automatic assignment of values, which is what you seem to be trying to do. How does it fail? It certainly works in 2000.
    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
  •