G
George Nicholson
Oh, benevolent and knowledgeable beings:
I have a subreport. In it's Open event I prompt the user to select between 3
sorting preferences. (The Open event & prompts are set to only happen once
and all the fields in the OrderBy are in the source for the subreport - I'm
pretty sure the problem doesn't lie there).
However, whenever I set the OrderBy or OrderByOn properties of the
subreport:
Select Case 1
Me.OrderBy = "Division, Entry"
Select Case 2
Me.OrderBy = "SourceType, Entry"
......yada, yada
Me.OrderByOn = True
I get error 2101 "The setting you entered isn't valid for this property."
Yet, the properties *DO* get set as indicated.
For the time being, I have preceded this section of code with "On Error
Resume Next" and everything works just like I would expect it to.
Using identical code in the Open event of a similar report (with no
subreport) does not raise an error. Why is it happening on a subreport? Is
this something I should worry about? Relying on "On Error Resume Next" as a
workaround to unexpected errors makes me very uncomfortable that it's going
to come back and bite me when I can least afford it.
Alternatively, is there any way to do what I am trying to do (set the
OrderBy of a subreport) from the Parent report? I made a few unsuccessful
attempts before trying this approach.
Ideas? Suggestions?
TIA,
I have a subreport. In it's Open event I prompt the user to select between 3
sorting preferences. (The Open event & prompts are set to only happen once
and all the fields in the OrderBy are in the source for the subreport - I'm
pretty sure the problem doesn't lie there).
However, whenever I set the OrderBy or OrderByOn properties of the
subreport:
Select Case 1
Me.OrderBy = "Division, Entry"
Select Case 2
Me.OrderBy = "SourceType, Entry"
......yada, yada
Me.OrderByOn = True
I get error 2101 "The setting you entered isn't valid for this property."
Yet, the properties *DO* get set as indicated.
For the time being, I have preceded this section of code with "On Error
Resume Next" and everything works just like I would expect it to.
Using identical code in the Open event of a similar report (with no
subreport) does not raise an error. Why is it happening on a subreport? Is
this something I should worry about? Relying on "On Error Resume Next" as a
workaround to unexpected errors makes me very uncomfortable that it's going
to come back and bite me when I can least afford it.
Alternatively, is there any way to do what I am trying to do (set the
OrderBy of a subreport) from the Parent report? I made a few unsuccessful
attempts before trying this approach.
Ideas? Suggestions?
TIA,