Kamis, 06 November 2014

Re: [MS_AccessPros] Filtering records using two criteria

 

John-


I would think that this:

  Me.Filter = "ReviewAssignedTo = '" & Me.cboReviewAssignedTo & _
     "' AND ReviewedMRR = False"

… would do it.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Nov 6, 2014, at 3:43 PM, jfakes@rocketmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

 Ok, my users want to open a form to view all records, view records that need to be reviewed.  This was easy to do and I have filter that does this.

 

Now the user wants to open the form, then select a reviewer and show only records that need to be reviewed.  I built a combobox that filters the records and shows only that reviewers records however, it shows all of their records not just the ones that need to be reviewed.

 

Here is my code for the combobox cboReviewAssignedTo wich populates the lookup list of reviewers for the combobox.  :

 

SELECT DISTINCT [qryABA-FormsMRRTEST].ReviewAssignedTo, [qryABA-FormsMRRTEST].ReviewedMRR FROM [qryABA-FormsMRRTEST] WHERE ((([qryABA-FormsMRRTEST].ReviewedMRR)=False));

 

After the user selects the reviewer name, the afterupdate command runs the following filter to show only records for that reviewer.  However, it shows all of their records, the user only wants to see the records that haven't been reviewed.

 

Private Sub cboReviewAssignedTo_AfterUpdate()
'Displays only records selected from combobox.
Me.Filter = "ReviewAssignedTo = '" & Me.cboReviewAssignedTo & "'"
Me.FilterOn = True
End Sub

 

I played around trying to put multiple criteria in the filter but that didn't work.  I need to add something like:  ReviewedMRR=False.

 

If the user didn't want several options to filter the data, it would be much simpler as I can't figure out how to filter by reviewer and open records.

 

Any suggestions?

 

John F

 
 

__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar