Filtering check box

  • Thread starter Birgit via AccessMonster.com
  • Start date
B

Birgit via AccessMonster.com

Hi!

I have a form with a checbox "Done" and command button "NotDone" with
following code:

Private Sub NotDone_Click()
Me.Filter = "Done=0"
Me.FilterOn = True
End Sub

This works properly on the first clicking after writing the code, but if I
stop filtering and click the button again I get message (in Finnish)
"Peruutit edellisen toiminnon" which means in English something like "You
cancelled previous action". Error number is 2001. When I delete the code and
save my project and restart Acces with my project and rewrite the code, the
first clicking works, but next clicking gives the same message. I think my
hair is getting grey soon. Can somebody help me, pease!
My Acces version is 2007.
 
B

boblarson

Try this instead:

Private Sub NotDone_Click()
Me.Filter = "Done = False"
Me.FilterOn = True
End Sub

And to reset it use:

Me.Filter = ""
Me.FilterOn = False

--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com

__________________________________
 
B

Birgit via AccessMonster.com

boblarson said:
Try this instead:

Private Sub NotDone_Click()
Me.Filter = "Done = False"
Me.FilterOn = True
End Sub

And to reset it use:

Me.Filter = ""
Me.FilterOn = False

Hi!

Thanks for reply, but the result is the same. I think if my form consists
some code somewhere else that causes this error.
[quoted text clipped - 14 lines]
hair is getting grey soon. Can somebody help me, pease!
My Acces version is 2007.
 
B

Birgit via AccessMonster.com

Birgit said:
Hi!

I have a form with a checbox "Done" and command button "NotDone" with
following code:

Private Sub NotDone_Click()
Me.Filter = "Done=0"
Me.FilterOn = True
End Sub

This works properly on the first clicking after writing the code, but if I
stop filtering and click the button again I get message (in Finnish)
"Peruutit edellisen toiminnon" which means in English something like "You
cancelled previous action". Error number is 2001. When I delete the code and
save my project and restart Acces with my project and rewrite the code, the
first clicking works, but next clicking gives the same message. I think my
hair is getting grey soon. Can somebody help me, pease!
My Acces version is 2007.

Problem solved!

It was in subform's code fault. Now goes wery well.

Thanks for interestin
Birgit
 

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