Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2003
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IIf and DCount (2002)

    The following statement is one column among several of a query used in an a listbox control:

    Assignment: IIf(DCount("[Prayor No]","Prayor Assignment Query","CLng([Prayor No]) = """ & [Prayor].[Prayor No] & """ And [Event Group] = """ & [Forms]![Session Management Form]![Event Group] & """ And CLng([Intake No]) = """ & [Forms]![Session Management Form]![Scheduled Prayees] & """")<[Forms]![Session Management Form]![Max Meetings],"Part","All")

    This statement causes Access 2002 to quit when the form is saved, whether the database is in Access 2000 or Access 2002 format . This problem does not occur when the database runs in Access 2000. Also, the problem does not occur if I use only the DCount function (no IIf) or if I replace the DCount function with, say, the number 3. Only when I use both the IIf and the DCount together does Access 2002 quit unexpectedly. Anyone have some clues? Thanks

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: IIf and DCount (2002)

    If you import everything into an empty database, do you still get the same behavior? Sometimes this sort of behavior is symptomatic of a corruption. Also, what Service Packs have been installed?
    Wendell

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: IIf and DCount (2002)

    Are you sure the form reference is returning a number? If the control is a textbox, it may be returning a string. Try wrapping the form reference in a CLng() function (assuming you might have that large a number) and see if that makes a difference.
    Charlotte

Posting Permissions

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