|
-
Jan 10th, 2007, 06:01 AM
#1
Thread Starter
New Member
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.
-
Jan 10th, 2007, 06:29 AM
#2
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.
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...
-
Jan 10th, 2007, 06:49 AM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|