runtime error 2501 ApplyFilter action was cancelled

runtime error 2501 ApplyFilter action was cancelled

am 23.01.2008 05:23:17 von dkohel

What is wrong with the following code?
I am trying to filter a form based on the selection of a combobox
named cblPRD

Dim currentFilter
currentFilter = "[prdID] = '" & Me!cboPRD & "'"
Filter = currentFilter
DoCmd.ApplyFilter , Filter

When the code executes, I trap and receive the following error...

Error Number: 2501
Error Description: The ApplyFilter action was cancelled

Re: runtime error 2501 ApplyFilter action was cancelled

am 23.01.2008 16:42:26 von Salad

dkohel@gmail.com wrote:

> What is wrong with the following code?
> I am trying to filter a form based on the selection of a combobox
> named cblPRD
>
> Dim currentFilter
> currentFilter = "[prdID] = '" & Me!cboPRD & "'"
> Filter = currentFilter
> DoCmd.ApplyFilter , Filter
>
> When the code executes, I trap and receive the following error...
>
> Error Number: 2501
> Error Description: The ApplyFilter action was cancelled

I sometimes set filters with code similar to

Me.Filter = "ID = 123"
Me.FilterOn = True

Twilight Zone
http://www.youtube.com/watch?v=a1sf2CzEq0w

Re: runtime error 2501 ApplyFilter action was cancelled

am 24.01.2008 04:36:27 von dkohel

Seems as though this issue only occurs when I have the prdID set as a
primary key. When I remove the primary key setting on that field, it
works fine. Any ideas why?

On Jan 22, 8:23 pm, "dko...@gmail.com" wrote:
> What is wrong with the following code?
> I am trying to filter a form based on the selection of a combobox
> named cblPRD
>
> Dim currentFilter
> currentFilter = "[prdID] = '" & Me!cboPRD & "'"
> Filter = currentFilter
> DoCmd.ApplyFilter , Filter
>
> When the code executes, I trap and receive the following error...
>
> Error Number: 2501
> Error Description: The ApplyFilter action was cancelled