Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo to show all information.

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
How do I get a combo box to show all records if the combo box that supplies it's information is blank. I know this was done recently but I can't find it. The second and third combos get criteria like this:

Second
[forms]![ReportForm]![txt1]
Third
[forms]![ReportForm]![txt1]
[forms]![ReportForm]![txt2]

But I would like the combos to show all records if "txt1" or "txt2" where blank but work as required to when there is a value in them.

 
Hi,
I found a way. For anyone with the same problem here is the Sql:

SELECT tbltruststaff.ChpLocation, tbltruststaff.Chp
FROM tbltruststaff
GROUP BY tbltruststaff.ChpLocation, tbltruststaff.Chp
HAVING (((tbltruststaff.ChpLocation) Is Not Null) AND ((tbltruststaff.Chp)=IIf([forms]![reportForm]![txt1] Is Null,[chp],[forms]![reportForm]![txt1])))
ORDER BY tbltruststaff.ChpLocation;



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top