i debugged the code, and did a quick watch to see the value of the empty listbox, and access is telling me that the value is null. now if the SQL string stops at that value, it works good and spits out the reults needed, but once you add the 2nd condition with the checkbox thats when it losses track of the value, so the best way, and easiest way is to add ALL to the listbox. at least thats what i think.
lol let me get the purpose of that SQL statement straight;
SQL statement is for a query? a report?
the first part works fine....
if the checkbox is checked, then you have to show the date?
if it is not,
dont have to show the date?
all this in a report? upon clickin it, it opens a report? a query/?
Originally posted by Jerrie
hmm the code seems fine. But the problem lies at the INNER JOIN. In this case, debugging wont help since the query string is executed at the end...
for that specific case thats causing you grief, paste that query expression into a new query design in SQL View and see if it runs...for that case though...
and also, add a ";" at the end...wont make a diff i think but try that...
both these mehtods, try that.
I pasted the SQL in a new query that would ask for the id or the "value" of the FacilityID, it works good, which makes me even more confussed. i also tried entering a zero'0' for the value, and it pulled the right info out to the report. yeap the way is to added "ALL" and asign its value to Null. for those that are looking for this code, there are 2 ways of doing it,
1) http://support.microsoft.com/?kbid=210290 (calling a function)
2)http://www.mvps.org/access/forms/frm0043.htm (doing it thru rowsource)