Results 1 to 8 of 8

Thread: Resolved:Wheres Waldo (or the problem :p)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    29

    Resolved Resolved:Wheres Waldo (or the problem :p)

    VB Code:
    1. If ComboInLabel.Caption = "Centimeters (Cm)" Or "Meters (M)" Or "Kilometers (Km)" Then
    2. CompatabilityInType = "Length"
    3. End If

    Im getting a type mismatch error, im guessing that IF cannot handle 'or' with strings? only numbers?

    thanks in advance
    Last edited by d22k; Apr 11th, 2005 at 10:54 AM.

  2. #2
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Re: Wheres Waldo (or the problem :p)

    VB Code:
    1. If ComboInLabel.Caption = "Centimeters (Cm)" Or ComboInLabel.Caption = "Centimeters (Cm)" 'etc

    You have to add the ComboInLable.Caption = after your Or
    Here's to us!
    Who's like us?
    Darned few, and they're all dead!

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Wheres Waldo (or the problem :p)

    ... or use Select Case syntax instead:
    VB Code:
    1. Select Case ComboInLabel.Caption
    2.     Case "Centimeters (Cm)"
    3.         '...
    4.     Case "Meters (M)"
    5.         '...
    6.     Case "Kilometers (Km)"
    7.         '...
    8. End Select
    9.  
    10. 'OR
    11.  
    12. Select Case ComboInLabel.Caption
    13.     Case "Centimeters (Cm)", "Meters (M)", "Kilometers (Km)"
    14.         '...
    15. End Select

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    29

    Re: Wheres Waldo (or the problem :p)

    thanks both of you,
    especially rhino (yet again )

    I wanted to use Case, however when i had tried it i had the synatx wrong, i had the Case of in brackets....

    anyways cheers

  5. #5
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Re: Resolved:Wheres Waldo (or the problem :p)

    Do they make those books anymore?

  6. #6

  7. #7

  8. #8
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Re: Resolved:Wheres Waldo (or the problem :p)

    Quote Originally Posted by RhinoBull
    I can write one for you ...
    Well if it was anything like the books I read (well umm seen), I think it would take you a few days to do so =P

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