Filtering Data - You canceled the previous operation

C

Chad Cameron

Hi All,

I need help with my filter. On the internet, I have found at least 5
different ways to write the filter, and none of them seem to work. I want
my filter to be based from a combobox, but for now I just want it to work
'hard coded'. Could someone please tell me where I need square brackets,
single quotes & double quotes. Every combination I have tried either gives
me the above error, or filters nothing or filters everything.

Access 2000

Me.Filter = "[Date] = '6/04/09'"
Me.FilterOn = True

Thanks
Chad
 
D

Dirk Goldgar

Chad Cameron said:
Hi All,

I need help with my filter. On the internet, I have found at least 5
different ways to write the filter, and none of them seem to work. I want
my filter to be based from a combobox, but for now I just want it to work
'hard coded'. Could someone please tell me where I need square brackets,
single quotes & double quotes. Every combination I have tried either
gives me the above error, or filters nothing or filters everything.

Access 2000

Me.Filter = "[Date] = '6/04/09'"
Me.FilterOn = True


You have a field named "Date"? That's a bad choice of names, as it
conflicts with the built-in Date function.

Is your "Date" field a text field, rather than a date/time field? If it's a
date/time field, your filter string should use the date delimiter (#), not
the text delimiter (').

Me.Filter = "[Date] = #6/04/09#"
 
C

Chad Cameron

I guess it has something to do with my date.
I can get it to work with CrewID

Chad
 
C

Chad Cameron

Thanks,

I needed the #

Chad

Dirk Goldgar said:
Chad Cameron said:
Hi All,

I need help with my filter. On the internet, I have found at least 5
different ways to write the filter, and none of them seem to work. I
want my filter to be based from a combobox, but for now I just want it to
work 'hard coded'. Could someone please tell me where I need square
brackets, single quotes & double quotes. Every combination I have tried
either gives me the above error, or filters nothing or filters
everything.

Access 2000

Me.Filter = "[Date] = '6/04/09'"
Me.FilterOn = True


You have a field named "Date"? That's a bad choice of names, as it
conflicts with the built-in Date function.

Is your "Date" field a text field, rather than a date/time field? If it's
a date/time field, your filter string should use the date delimiter (#),
not the text delimiter (').

Me.Filter = "[Date] = #6/04/09#"


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top