July 4, 2006 at 9:30 am
Hi ,
I'm trying to use a command button to filter the current form.
When clicked on it should show all records where the discharge box is not ticked .
This box is also on the form - i tried to get data when the value is 0.
HELP
filteringStr = filteringStr & "qryNotDischarged.Discharged_ ='" & Me.Discharged_.Value = 0 & "'"
Regards
Ritesh
July 4, 2006 at 2:41 pm
Can you post the full content of filteringstr?
debug.print filteringStr
a guess
if Me.Discharged_.Value = 0 then
if filteringStr="" then
filteringStr =qryNotDischarged.Discharged=0
else
filteringStr = filteringStr & " AND qryNotDischarged.Discharged=0"
end if
else
end if
July 5, 2006 at 7:02 am
Put a breakpoint after those lines and will see your quotes are in the wrong place.
Me.Discharged_.Value = 0
Evaluates to True or False. If discharged is a number then you don't need the quotes at all
July 5, 2006 at 11:46 am
I'm assuming that your back-end data is in SQL Server. If Discharged is a Yes/No field in Access you would just want to either have "AND Discharged" or "AND NOT Discharged" depending on the status of the checkbox.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply