Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303

    Unanswered: how to use a string for an operator?

    If (CInt(rs!Result) & rsChain!Operator & CInt(rsChain!TriggerValue)) Then

    rs!Result = 5
    rsChain!Operator = "<>"
    rs!TriggerValue = 0

    Access does not perform the comparison. Type Mismatch error.
    Below is another possible data set.

    rs!Result = 3
    rsChain!Operator = "="
    rs!TriggerValue = 1

    How do I create an If/then statement with a string for an operator?
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    Look up the Eval() function.

    Eval(CStr(Result) & Operator & CStr(TriggerValue)) returns -1 (true) in my quick test. And 0 (false) when I change the triggervalue to 5.

  3. #3
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Perfect.

    Viva la Eval!

    Thanks ivon
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

Posting Permissions

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