Results 1 to 3 of 3

Thread: Show all results except a specified selection

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    2

    Show all results except a specified selection

    Sorry but I am totally new to all of this.

    I have been asked to amend an Access 2003 database (based on Microsofts Issue logging database) so that we can search by all current jobs. At the moment we can search for all jobs (showall) or specific ones (exact match). How can I ask that if the search status criteria is "Current" show all records except those with a "Finished" status?

    The current script is shown below:

    'If Status
    If Nz(Me.Status) = "All" Then
    'Add it to the predicate - showall
    Else
    'Add it to the predicate - exact match
    strWhere = strWhere & " AND " & "Issues.Status = '" & Me.Status & "'"
    End If

    Hope this makes sense.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Show all results except a specified selection

    Code:
    'If Status
    If Nz(Me.Status) = "All" Then
    'Add it to the predicate - showall
    Else
    'Add it to the predicate - exact match
    strWhere = strWhere & " AND " & "Issues.Status = '" & Me.Status & "'"
    End If
    change to a Frame (poss?)
    option 1 of the frame -> All
    option 2 of the frame -> Matches Status
    option 3 of the frame -> Unfinished

    code:
    Code:
    '---- for type 1 (show all) no filtere required!
    select case fraChoice 'the name of the frame object
    case 2
    '---- show only those specified
        strWhere = strWhere & " AND " & "Issues.Status = '" & Me.Status & "'"
    case 3
    '---- show unfinished only
        strWhere = strWhere & " AND " & "Not (Issues.Status = 'Finished')"
    '---- note the above assumes Finished is the text in the status
    end select
    Or you can use a variation and code to do the same.

    Essentially the strWhere is the Where clause of the sql statement and you are requested either a sppecific status or one that is not finished.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    2

    Resolved Re: Show all results except a specified selection

    Thank you very much. It worked perfectly.

Posting Permissions

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



Click Here to Expand Forum to Full Width