You need to change it to
SELECT TBL_Issues.Responsible, TBL_Issues.Status, TBL_Issues.Programme,
TBL_Issues.IssueNumber, TBL_Issues.Issue, TBL_Issues.Recommendation,
TBL_Issues.DateRaised, TBL_Issues.DateCompleted, TBL_Issues.Comments
FROM TBL_Issues
WHERE (TBL_Issues.Responsible=[Forms]![Main]![cboResponsible]
OR [Forms]![Main]![cboResponsible]="(All)")
AND (TBL_Issues.Status=[Forms]![Main]![cboStatus]
OR [Forms]![Main]![cboStatus])="(All)")
AND (TBL_Issues.Learner=[Forms]![Main]![cboLearner]
OR [Forms]![Main]![cboLearner])="(All)")
ORDER BY TBL_Issues.IssueNumber
You used two separate criteria rows to build your query, didn't you? What
you have to realize using the query grid is that it ANDs together all
criteria on one row, and ORs rows of criteria together.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Neil M said:
oops last one was wrong code, here it is;
SELECT TBL_Issues.Responsible, TBL_Issues.Status, TBL_Issues.Programme,
TBL_Issues.IssueNumber, TBL_Issues.Issue, TBL_Issues.Recommendation,
TBL_Issues.DateRaised, TBL_Issues.DateCompleted, TBL_Issues.Comments
FROM TBL_Issues
WHERE (((TBL_Issues.Responsible)=[Forms]![Main]![cboResponsible]) AND
((TBL_Issues.Status)=[Forms]![Main]![cboStatus]) AND
((TBL_Issues.Learner)=[Forms]![Main]![cboLearner])) OR
((([Forms]![Main]![cboResponsible])="(All)") AND
(([Forms]![Main]![cboStatus])="(All)") AND
(([Forms]![Main]![cboLearner])="(All)"))
ORDER BY TBL_Issues.IssueNumber;
SELECT Learner, Learner FROM TBL_Issues
UNION SELECT "(All)" AS Tom, Null AS M FROM TBL_Issues;
Sounds as though you're working with the query-building grid.
For something like this, it's much better to work directly with
the
SQL.
WIth the query open, select SQL View from the View menu.
Copy and paste your SQL below, and I'll take a look at it.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Right I have got it now working partly;
I changed the query code to look like this for each:
Criteria: [Forms]![Main]![cboResponsible]
OR: [Forms]![Main]![cboResponsible]="(All)"
Which was weird cause that didn't work first of all.
But now I have the probloem that it only displays All when I select
ALL
on
all 3 comboboxes.
If I decide to select Learners = ALL, Named Responsible and