Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Posts
    15

    Unanswered: =Sum((IIF......... Problem

    I am having trouble with a control source of a Text Box.

    I want to be able to count the number of "Reservations" on my continuous form

    So Ive sent up a text box with the control source equal to

    =Sum(IIf([Status]="Reserved,1,0)):

    I then save my form and go into Form View and the code i just wrote in the control source box just goes away

    I have no clue whats going on. The form and its list is created by a query, is there anything i need to turn on or turn off before i can do this?

  2. #2
    Join Date
    May 2004
    Posts
    80

    Try it again...

    Hi

    This is the first post I've been able to answer from experience. I've had this problem before. For some reason, Access doesn't always save the text you put in the control source, even if you actually save it (if you get what I mean!!) Sometimes you have to re-paste it three or four times. Just make sure you're in Design view and try it again, saving it each time. Eventually, it should work. Also, you may want to try (assuming there's a function for this - check the expression builder) =Count instead, if all you want to do is count the number of reservations. The rest of your code, despite my inexperience, sounds like it should work.

    If this doesn't work, post again and I'll see if I can help any more.

  3. #3
    Join Date
    May 2004
    Posts
    15
    so nothing wrong with my code??


    just keep on trying it until its actually saved??

  4. #4
    Join Date
    May 2004
    Posts
    80

    Well...

    I can't actually say for sure that your code is OK, because I don't have a lot of experience with that side of things; but all I can say for now is try out that saving thing, because I'm having that problem myself with a similar thing. Good luck.

  5. #5
    Join Date
    Jan 2004
    Posts
    2

    Red face

    have u put the quotes on purpose ? try to put the quotes before and after the text content .. it works fine with me.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    =Sum(IIf([Status]="Reserved,1,0)):
    You are missing a closing quote in your IIF() statement. Try re-writing the statement like so:
    =Sum(Iif([Status]="Reserved", 1, 0)
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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