Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    240

    Unanswered: Need help with query expression

    Hi,

    I have a query which I would like to an an expression to, but am having problems doing it.

    I have a form that has a listbox that lists names and has a hidden column for the hidden ID.
    This hidden ID is the same as the primary key for each record in one of my tables.

    In my query I want an expression that says, if nothing is selected in the listbox then bring back all records, else bring back just the selected record.

    Code:
    Nz([Forms]![frmReports]![listEmp], "*")
    Code:
    IIf(IsNull([Forms]![frmReports]![listEmp]),"*",[Forms]![frmReports]![listEmp])
    I have tried the above two expressions but neither worked, can anyone help?

    Thanks

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    Like IIf(IsNull([Forms]![frmReports]![listEmp]),"*",[Forms]![frmReports]![listEmp])


    Seem to do it ??

    or even

    Like Nz([Forms]![Form1]![List21],"*")


    On the basis that it is the primary key.


    MTB

Posting Permissions

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