Results 1 to 5 of 5

Thread: DAO and enum`s

  1. #1

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901

    DAO and enum`s

    I have a problem using enums in a DAO query
    seems that dec.m_MediaType = 1 when i am looking to match a STRING in a table.

    Is there a way around this? or am i stuck putting index numbers in my access table. ?




    VB Code:
    1. rstVelocity.Index = "PrimaryKey"
    2.     rstVelocity.Seek "=", dec.m_MediaType ' NEED STRING NOTNUMBER
    3.         mDucting.Description.m_roomVelocity = rstVelocity(1) 'just in case we need it
    4.         mDucting.Description.m_cfm = rstVelocity(1) * (dec.m_roomWidth * dec.m_roomHeight)
    5. rstVelocity.Close
    6.  
    7.  
    8.  
    9.  
    10.  
    11. ' HERES MU ENUM
    12.  
    13. Public Enum MediaType
    14.     AlumOxide
    15.     Sand
    16.     StarBlast
    17.     SteelGrit
    18. End Enum



    Thanks Seahag

  2. #2

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901
    is it me or is that banner getting bigger ^^


    Seahag

  3. #3

  4. #4
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    Don't think so.

    Isn't it so the enumerator represents a number , you can use the referencing name in code but you're working with the number.

    I think it would be better to work with a UDT and fill them needed values accordingly.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  5. #5

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901
    your right no worky.


    UDT.. prolly will work.. to much to change now..
    i will remember that for my next project.

    Enums are great for pickin up spekking mistakes.

Posting Permissions

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



Click Here to Expand Forum to Full Width