Welcome to SPN

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

Sign Up Now!

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?
     

Share This Page