Results 1 to 5 of 5

Thread: error when using enums!

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    UK
    Posts
    36

    Angry

    Does anyone know a fix or workaround for the bug when running and VB trying to recognize enums?
    I have set up valid enums and sometimes the program runs without error and other times I get a message that says "Constant Expression Required"!!!! This is really nagging at me know!, can anyone help!!!!!

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    if you could post up a snippet of code so we can see whats going on that would be cool...
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    UK
    Posts
    36

    Post

    I set my enum up as so:

    Private Enum eLckups
    WorkRec = 0
    MapType = 1
    ManCat = 2
    BillType = 3
    End Enum

    And then in form load I am trying to ref the enum and it gives me the error!

    dtgMap.RowHeight = cboLckups(eLckups.WorkRec).Height

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Try declaring your enum as public in a BAS module instead.

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    UK
    Posts
    36

    Smile

    Thanks that seems to work but obviously this error/bug occurs in-frequently so if I get it at any time I will let you all know!
    Cheers Chaps

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