Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

MS Access IIF error on report

Discussion in 'Information Technology' started by Kenny Miller, Jul 28, 2006.

  1. Kenny Miller

    Kenny Miller
    Expand Collapse
    Guest

    I have been trying to run the following IIF in a report

    =IIf([Neighborhood]="Downtown Brooklyn","Downtown",[Neighborhood])
    but I get #error in the report

    when I replace the feild with test & run the report it works
    =IIf([test]="Downtown Brooklyn","Downtown",[test])
    however this is a table which I need to download & replace often.

    Any Suggestions?
     
  2. Loading...


  3. Rob Parker

    Rob Parker
    Expand Collapse
    Guest

    The most likely cause is that the textbox control is also named
    Neighborhood. Change it to txtNeighborhood and your problem should go away.
    It's a common problem, caused by Access's default names. To avoid it, use a
    naming convention for your controls (and turn off Name Autocorrect in your
    application).

    HTH,

    Rob

    "Kenny Miller" <kennymiller@gmail.com> wrote in message
    news:3861d86d71e64cb9b6442a409f0efe34@ureader.com...
    >I have been trying to run the following IIF in a report
    >
    > =IIf([Neighborhood]="Downtown Brooklyn","Downtown",[Neighborhood])
    > but I get #error in the report
    >
    > when I replace the feild with test & run the report it works
    > =IIf([test]="Downtown Brooklyn","Downtown",[test])
    > however this is a table which I need to download & replace often.
    >
    > Any Suggestions?
     
  4. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Rob Parker wrote:

    > It's a common problem, caused by Access's default names...


    Weeell, not exactly. Access's default names apply to controls that are
    directly bound to the fields of the same name, which is not a problem.
    The problems arise when a control has the same name as a field in the
    record source, but is is *not* bound to that field. This situation is
    always the result of user intervention, and is never done by Access by
    default.

    --
    Steve Schapel, Microsoft Access MVP
     
  5. Larry Linson

    Larry Linson
    Expand Collapse
    Guest

    Another possibility: Is [Neighborhood] the Control Source of a Control on
    the Report? Access reports are "smart enough" that they may eliminate fields
    specified in the Record Source if they aren't actually displayed.

    Larry Linson
    Microsoft Access MVP

    "Kenny Miller" <kennymiller@gmail.com> wrote in message
    news:3861d86d71e64cb9b6442a409f0efe34@ureader.com...
    >I have been trying to run the following IIF in a report
    >
    > =IIf([Neighborhood]="Downtown Brooklyn","Downtown",[Neighborhood])
    > but I get #error in the report
    >
    > when I replace the feild with test & run the report it works
    > =IIf([test]="Downtown Brooklyn","Downtown",[test])
    > however this is a table which I need to download & replace often.
    >
    > Any Suggestions?
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page