Filter Subquery or display All

I

idtjes3

Hello,

I have a Form with a subquery on it via tab control. I have one combo box
on the main form that has employee names in it. When I select an employee,
the query runs and displays all the projects and hours they employee has
worked on in the subform. I have a second box which contains every projects
"ProjectID" that I want to use to filter through the projects so I can only
view the records of a single Project. I can get the show selected project to
work, however I cant get the query to display all the records if the combo
box is blank, or better yet, reads " Show All". heres what Ive done so far:
In the query under ProjectID I have the following criteria:
IIF([Forms]![Employee Information].[ProjectSelect]="Show
All","*",[Forms]![Employee Information].[ProjectSelect])
On the Form for the second combo box I have its default value to; ="Show All"
In the first combo box ( employee name search) I have to following code:
Private Sub cmbEmployeeID_AfterUpdate()
Me.ProjectSelect.Value = "Show All"
DoCmd.ShowAllRecords
Me!EmployeeID.SetFocus
DoCmd.FindRecord Me!cmbEmployeeID
End Sub
This way when I choose another employee in the combo box, it SHOULD default
the second box back to "Show All" which should then display every job the
employee has worked on. Any Ideas as to why its not displaying all results
when the combo box clearly says Show All? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top