473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Trying to set OrderBy in Report On Open Event

Hello

I am setting the Order By property of a subreport on the On Open Event of
the subreport
and I am getting the following error:

error number 2101 ( The setting you entered isn't valid for
this property.)

Oddly enough, event though I get this error , the Order By property settings
I am making on the On Open Event still work
when I open the subreport ; should I just capture this error and ignore it ?
I don't like doing that if there is a work around.

I get the same error if I try to set the Order By On , Filter, Filter On
properties.

If I open the subreport by itself (as a report ) , I don't get this error.

Here is the code I am using:

Dim MySort as String
Set MySet = MyDb.OpenRecordset("TblSortSub", DB_OPEN_DYNASET)
MySet.MoveFirst
If MySet!AllSort = -1 then
MySort = MySet!FirstField & "," & MySet!SecondField
Me.OrderBy = MySort
End If
MySet.Close

I am running Access 2000

Thanks
G.Gerard

Nov 12 '05 #1
1 5740
"G.Gerard" wrote:
Hello

I am setting the Order By property of a subreport on the On Open Event of
the subreport
and I am getting the following error:

error number 2101 ( The setting you entered isn't valid for
this property.)

Oddly enough, event though I get this error , the Order By property settings
I am making on the On Open Event still work
when I open the subreport ; should I just capture this error and ignore it ?
I don't like doing that if there is a work around.

I get the same error if I try to set the Order By On , Filter, Filter On
properties.

If I open the subreport by itself (as a report ) , I don't get this error.

Here is the code I am using:

Dim MySort as String
Set MySet = MyDb.OpenRecordset("TblSortSub", DB_OPEN_DYNASET)
MySet.MoveFirst
If MySet!AllSort = -1 then
MySort = MySet!FirstField & "," & MySet!SecondField
Me.OrderBy = MySort
End If
MySet.Close

I am running Access 2000

Thanks
G.Gerard


Usually you use GroupLevel and the SortOrder properties to set the sort order of
a report.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: P. Emigh | last post by:
By default in more recent versions, Access forms keep users' last sort request in the "orderby" property. That can slow things down considerably, especially when the last user has chosen a...
2
by: DFS | last post by:
Access97: I opened a report, then opened a small form that floats above it and lets you choose report fields to sort on (by issuing the OrderBy statement). Well, apparently OrderBy actually...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: CSDunn | last post by:
Hello, I have an Access 2003 report that opens in print preview and then maximizes upon clicking a button from a form. The OnClick event of the button fires a macro to open the report. How can...
1
by: fecket | last post by:
The following code is used in my db to change the sort order of the report to various fields. I want to take this one stage further and use maybe a Case Select to give 2 or 3 different options to...
2
by: john | last post by:
My report is based on a query with user input . In my report I have a text box with the following code: =. This works when the query outcome is 1 or more records. But when the query output is zero...
3
by: gmazza via AccessMonster.com | last post by:
Hi there, I am trying to run a report using a parameter for where the user chooses a month from a combo box. Then on the report, I want it to compare the month to a date field and choose only...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
9
by: sparks | last post by:
Right now I had to build a report that allowed the people to check for gross outliers in their data input. short I am looking at 2.5* std dev + - anyway I used 2 dummy variables in the query the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.