Re: IIf problem with <>
- From: Dale Fye <dale.fye@xxxxxxxxxx>
- Date: Tue, 2 Sep 2008 08:48:24 -0700
Steve,
I assume that your checkbox is in the header, and basically, what you want
is to either turn off the filter or turn it on. Is that correct? If so, I
would put the following code in the checkboxes AfterUpdate event.
Private sub ShowComplete_AfterUpdate
If me.ShowComplete = True then
me.filter = "[Status] = 'Complete'"
me.filteron = true
Else
me.Filter = ""
me.Filteron = False
endif
End sub
--
HTH
Dale
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
"Steve" wrote:
I dont understand what you are saying as it seems simple enough but the iif.
statment just dont seem to want to accept the not the same as the word
Complete which is a value that is in the field being checked.
the field has only three possabilities Complete,Working,Checked
the form is set to Continuous Forms and all I want to be able to to is
filter out the records that have been completed by changing its recourd
source to the query. selecting a tick box that indicates show completed jobs
or show all jobs and I would have though the iif statment would have done it.
Regards
Steve
from a land down under
"Marshall Barton" wrote:
Steve wrote:
Hi can anybody please tell me why this query criteria does not work.
IIf([Forms]![RegisterFrm]![ShowComplete]=True,[RegisterTbl]![Status],<>"Complete")
I have a tick box on a form called ShowComplete that can be set to true or
false
when it is set to true I want it to show all records no matter what is in
the status field. but if the tick box is set to false I want all records
except the records with the word "Complete" to show. what have I done wrong
in the iif statement.
You are trying to construct a criteria cell for the query
designer. That really doesn't make sense when the query is
executed where a function returns a **value**, not part of
an expression.
Try setting the field's criteria:
RegisterTbl.Status Or Forms!RegisterFrm!ShowComplete=True
--
Marsh
MVP [MS Access]
- References:
- IIf problem with <>
- From: Steve
- Re: IIf problem with <>
- From: Marshall Barton
- Re: IIf problem with <>
- From: Steve
- IIf problem with <>
- Prev by Date: RE: pass multi selected list box to query
- Next by Date: Re: NULL isn't always NULL
- Previous by thread: Re: IIf problem with <>
- Next by thread: Re: IIf problem with <>
- Index(es):
Relevant Pages
|