Error 2101

L

Len

I am trying to set a filter in sub-report in the Open event using the
following code:

strOpenArgs = Parent.OpenArgs
Select Case strOpenArgs
Case "Expiration"
strFilter = "ExpirationDate <= #" &
[Forms]![frmMenu]![frmMenuSubform].[Form]![txtExpirationDate] & "#"
Me.Filter = strFilter
Me.FilterOn = True

End Select

When running the procedure after the statement

Me.Filter = strFilter

I am getting the following error: error 2101 “The setting you entered isn’t
valid for this propertyâ€

What can be the reason? Thanks.
 
A

Arvin Meyer [MVP]

Posting a small snippet can be of help. but not in this case. The error
message may not be accurate and without seeing all the code, I doubt if
anyone can give you a decent answer.
 
L

Len

This is a whole code. Let me just re-phraze the question: I have a string and
need to apply this string as a filter to a sub-report when main report is
opening. I've performed the same task in main form - sub-form situation
assigning filter to sub-form from command button on main form and it works
fine. Any idea on resolving this issue greatly appreciated.

Arvin Meyer said:
Posting a small snippet can be of help. but not in this case. The error
message may not be accurate and without seeing all the code, I doubt if
anyone can give you a decent answer.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Len said:
I am trying to set a filter in sub-report in the Open event using the
following code:

strOpenArgs = Parent.OpenArgs
Select Case strOpenArgs
Case "Expiration"
strFilter = "ExpirationDate <= #" &
[Forms]![frmMenu]![frmMenuSubform].[Form]![txtExpirationDate] & "#"
Me.Filter = strFilter
Me.FilterOn = True

End Select

When running the procedure after the statement

Me.Filter = strFilter

I am getting the following error: error 2101 "The setting you entered isn't
valid for this property"

What can be the reason? Thanks.
 
B

BruceM

I would suggest stepping through the code. At each line of code, be sure
that the strings are what they should be.
Another point is that if this is all of your code, you have not declared
your variables, so they are by default Variants. This will not necessarily
give you the desired result.

Len said:
This is a whole code. Let me just re-phraze the question: I have a string
and
need to apply this string as a filter to a sub-report when main report is
opening. I've performed the same task in main form - sub-form situation
assigning filter to sub-form from command button on main form and it works
fine. Any idea on resolving this issue greatly appreciated.

Arvin Meyer said:
Posting a small snippet can be of help. but not in this case. The error
message may not be accurate and without seeing all the code, I doubt if
anyone can give you a decent answer.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Len said:
I am trying to set a filter in sub-report in the Open event using the
following code:

strOpenArgs = Parent.OpenArgs
Select Case strOpenArgs
Case "Expiration"
strFilter = "ExpirationDate <= #" &
[Forms]![frmMenu]![frmMenuSubform].[Form]![txtExpirationDate] & "#"
Me.Filter = strFilter
Me.FilterOn = True

End Select

When running the procedure after the statement

Me.Filter = strFilter

I am getting the following error: error 2101 "The setting you entered
isn't
valid for this property"

What can be the reason? Thanks.
 

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