Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Slovakia
    Posts
    32

    Unanswered: sum(switch(...))

    Hello,

    I have a datasheet with 2 columns:
    a = some value
    b = switch([a]=1;2;[a]=2;2;[a]=3;3)

    I am using this datasheet and on the main form I want to use this expression (as a ControlSource of a textbox): sum(switch([a]=1;2;[a]=2;2;[a]=3;3)), but the result is #Error.

    What's wrong?

  2. #2
    Join Date
    Jun 2003
    Location
    Belgium
    Posts
    133

    Re: sum(switch(...))

    Originally posted by sztomi
    Hello,

    I have a datasheet with 2 columns:
    a = some value
    b = switch([a]=1;2;[a]=2;2;[a]=3;3)

    I am using this datasheet and on the main form I want to use this expression (as a ControlSource of a textbox): sum(switch([a]=1;2;[a]=2;2;[a]=3;3)), but the result is #Error.

    What's wrong?
    Don't use that expression as a controlsource.
    You should first create a query on your table and use there the following expression

    Expr1 : switch([a]=1;2;[a]=2;2;[a]=3;3)

    You can then summarize Expr1 on your form when you use the query as recordsource for your form

  3. #3
    Join Date
    Jan 2004
    Location
    Slovakia
    Posts
    32

    many thanks

    Thank you! It helps!

Posting Permissions

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