Thread: filtering
View Single Post
  #6  
Old December 30th, 2006, 12:13 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default filtering

That very misleading error message can occur if you've mistyped the name of
a field or table.

Since the only difference between the working and non-working code appears
to be the addition of the field [Nu nog leerling], make sure that name is
typed correctly.

The single quotes around J should be no problem.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jean-Paul" wrote in message
...
Hey....
I wrote:

Private Sub Form_Load()
Me.FilterOn = True
If ALleofNu = "N" Then
Me.Filter = "Patienten.[kineitem] = false"
Me.filteron = True
endif
End Sub

with perfect result...
But when I canhed it all into:

Private Sub Form_Load()
Me.FilterOn = True
If ALleofNu = "N" Then
Me.Filter = "Patienten.[kineitem] = false"
Else
Me.Filter = "Patienten.[kineitem] = false AND Patienten.[Nu nog
leerling] = 'J' "
End If
End Sub

I get an errormessage 2001 (no help available) saying (and now I have to
translet so the syntax may be different)
"You dismissed previous action"

What do I do wrong this time?
Also I doubt if the syntax
"Patienten.[kineitem] = false AND Patienten.[Nu nog leerling] = 'J' "
will work because of the quotes ('J' ")

Thanks fo your kind help and best wishes for 2007
JP Belgium

strive4peace schreef:
Hi Jean-Paul,

if you are filling the property in directly for Filter, do not use quotes

Also, there is no FilterOn property in the property sheet...

a suggestion:
put spaces on either side of your operator
kineitemtrue -- kineitem true

Is kineitem defined to be Yes/No? Is kineitem in the form RecordSet?

Warm Regards,
Crystal
*
(: have an awesome day
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Jean-Paul wrote:
I did that in the properties of the form itself... not in the Load-event
I don't think this should make any difference, but it still doesn't
work!!
strange
JP

strive4peace schreef:
Hi Jean-Paul,

in addition to *Filter* forms also have a *FilterOn* property

you can do this on the form Load event...

'~~~~~~~~~~~~~~~~~
me.Filter = "kineitem true"
me.FilterOn = true
'~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal
*
(: have an awesome day
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Jean-Paul wrote:
Hi,
My form is based upon a table (of course...)
In the properties I set "kineitemtrue" as filter
filter is set to true

When I "walk" through my records, I see all records, even those with
"kineitems = true"

What can cause this?

Thanks
JP