Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: check a forms list box value in a qry

    I have a qry that needs to check the value of a list box on a form and return null or 1, the form is frmReport the listbox is lbReport


    in the qry field i will have something like :
    iif(frmReport.lbreport (what do i use here? Code.value ? Code.ListIndex) = cp(for value), 5 for listIndex),null,1)

    i dont know the syntax for checking the lb properties, or what property to use.

  2. #2
    Join Date
    Oct 2003
    Posts
    233
    The problem diff make table qry is run depending on the value in the lb. and if the value is avalue then some columns will not be available, IIF evaluates both sides so i would still get the error, What i will do is add dummy cols the the make table that is run for aValue

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    [Forms]![frmReport]![lbreport] is enough to reference the listbox.

    As for the rest, sorry, you lost me.... and I read both posts twice! I must be tired or something ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    iif(forms!frmreport!lbreport.value=<MyValue>,<UseT hisValueOnTrue>,<UseThisValueOnFalse>)

Posting Permissions

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