By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

Report Sorting at Run Time

P: n/a
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....

And another post that was OrderByOn = True and setting the sort Order.

The second works, but since I can't use Sorting and Grouping, I can't
get totals that I need.

The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first Sort/
Group, Followed by Trailer #.

So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)

Perhaps I should be writing a separate report with the desired sort
and totals? I'm not sure - I know I could use just the one query, but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in others.
But I'd love confirmation or correction on this.

Thanks -
sara

Code:

Select Case Forms.frmPrintReports.fraOBReports

Case 1
' Default Report Sort: Whse, Date, Trailer#

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open

Case 2
' Default Sort: Whse, Date, Trailer#

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"

GoTo Exit_Report_Open

Case 3
' Dept Sort: Whse, Date, Dept

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"

GoTo Exit_Report_Open

Case 4
' Goods Type Sort: Whse, GoodsType, Date

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"

GoTo Exit_Report_Open

Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'

GoTo Exit_Report_Open

End Select

(Error handling here)

May 11 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Have you tried setting a break point and stepping though the code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your cases?
Also GroupLevel() numbers change as you add and remove groups.

"sara" <sa*******@yahoo.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....

And another post that was OrderByOn = True and setting the sort Order.

The second works, but since I can't use Sorting and Grouping, I can't
get totals that I need.

The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first Sort/
Group, Followed by Trailer #.

So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)

Perhaps I should be writing a separate report with the desired sort
and totals? I'm not sure - I know I could use just the one query, but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in others.
But I'd love confirmation or correction on this.

Thanks -
sara

Code:

Select Case Forms.frmPrintReports.fraOBReports

Case 1
' Default Report Sort: Whse, Date, Trailer#

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open

Case 2
' Default Sort: Whse, Date, Trailer#

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"

GoTo Exit_Report_Open

Case 3
' Dept Sort: Whse, Date, Dept

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"

GoTo Exit_Report_Open

Case 4
' Goods Type Sort: Whse, GoodsType, Date

Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"

GoTo Exit_Report_Open

Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'

GoTo Exit_Report_Open

End Select

(Error handling here)

May 15 '07 #2

P: n/a
On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your cases?
Also GroupLevel() numbers change as you add and remove groups.

"sara" <saraqp...@yahoo.comwrote in message

news:11**********************@h2g2000hsg.googlegro ups.com...
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the sort Order.
The second works, but since I can't use Sorting and Grouping, I can't
get totals that I need.
The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)
Perhaps I should be writing a separate report with the desired sort
and totals? I'm not sure - I know I could use just the one query, but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -

- Show quoted text -
There are no errors; code all executes and report is displayed.

I know the headers change as you add and remove, but I'm not sure how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.

I'm thinking that I have to create a separate report for each "view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?

Thanks -
sara
May 17 '07 #3

P: n/a

"sara" <sa*******@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your cases?
Also GroupLevel() numbers change as you add and remove groups.

"sara" <saraqp...@yahoo.comwrote in message

news:11**********************@h2g2000hsg.googlegro ups.com...
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the sort Order.
The second works, but since I can't use Sorting and Grouping, I can't
get totals that I need.
The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)
Perhaps I should be writing a separate report with the desired sort
and totals? I'm not sure - I know I could use just the one query, but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -
- Show quoted text -

There are no errors; code all executes and report is displayed.

I know the headers change as you add and remove, but I'm not sure how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.

I'm thinking that I have to create a separate report for each "view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?

Thanks -
sara

The code may execute by you still have an error, Step though the code, I
would bet that frmPrintReports.fraOBReports in your Case statement is Null
or undefined. As for using a seperate report for each view, you logic looks
OK for changing sort order. Get the code working and one report should
handle you needs.
May 18 '07 #4

P: n/a
On May 18, 8:58 am, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message

news:11**********************@o5g2000hsb.googlegro ups.com...


On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your cases?
Also GroupLevel() numbers change as you add and remove groups.
"sara" <saraqp...@yahoo.comwrote in message
>news:11**********************@h2g2000hsg.googlegr oups.com...
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the sort Order.
The second works, but since I can't use Sorting and Grouping, I can't
get totals that I need.
The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)
Perhaps I should be writing a separate report with the desired sort
and totals? I'm not sure - I know I could use just the one query, but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -
- Show quoted text -
There are no errors; code all executes and report is displayed.
I know the headers change as you add and remove, but I'm not sure how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.
I'm thinking that I have to create a separate report for each "view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?
Thanks -
sara

The code may execute by you still have an error, Step though the code, I
would bet that frmPrintReports.fraOBReports in your Case statement is Null
or undefined. As for using a seperate report for each view, you logic looks
OK for changing sort order. Get the code working and one report should
handle you needs.- Hide quoted text -

- Show quoted text -
I have checked as you suggested, and all is well.

I put "Break on all errors" - no errors
I stepped through the code - no errors; it follows as I would expect.
I checked the value of fraOBReports in the selectcase statements, and
it was "5" both times.

Any other ideas?

thanks -
sara

May 18 '07 #5

P: n/a

"sara" <sa*******@yahoo.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
On May 18, 8:58 am, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message

news:11**********************@o5g2000hsb.googlegro ups.com...


On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your
cases?
Also GroupLevel() numbers change as you add and remove groups.
"sara" <saraqp...@yahoo.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the sort
Order.
The second works, but since I can't use Sorting and Grouping, I
can't
get totals that I need.
The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first
Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)
Perhaps I should be writing a separate report with the desired
sort
and totals? I'm not sure - I know I could use just the one query,
but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in
others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -
- Show quoted text -
There are no errors; code all executes and report is displayed.
I know the headers change as you add and remove, but I'm not sure how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.
I'm thinking that I have to create a separate report for each "view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?
Thanks -
sara
The code may execute by you still have an error, Step though the code, I
would bet that frmPrintReports.fraOBReports in your Case statement is
Null
or undefined. As for using a seperate report for each view, you logic
looks
OK for changing sort order. Get the code working and one report should
handle you needs.- Hide quoted text -

- Show quoted text -

I have checked as you suggested, and all is well.

I put "Break on all errors" - no errors
I stepped through the code - no errors; it follows as I would expect.
I checked the value of fraOBReports in the selectcase statements, and
it was "5" both times.

Any other ideas?

thanks -
sara
Is the code in the Report Open event?
May 18 '07 #6

P: n/a
On May 18, 12:30 pm, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message

news:11*********************@y80g2000hsf.googlegro ups.com...


On May 18, 8:58 am, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message
>news:11**********************@o5g2000hsb.googlegr oups.com...
On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your
cases?
Also GroupLevel() numbers change as you add and remove groups.
"sara" <saraqp...@yahoo.comwrote in message
>news:11**********************@h2g2000hsg.googlegr oups.com...
Hi -
I have looked at all posts and tried both Allen Browne's Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the sort
Order.
The second works, but since I can't use Sorting and Grouping, I
can't
get totals that I need.
The first works in one App, but does not work now. Any idea why?
When I run for any option, I get the OutboundDate as the first
Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled by
Trailer)
Perhaps I should be writing a separate report with the desired
sort
and totals? I'm not sure - I know I could use just the one query,
but
I'm trying to be efficient, if possible. I have the feeling it's
because I have header, totals in some footers and blanks in
others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -
- Show quoted text -
There are no errors; code all executes and report is displayed.
I know the headers change as you add and remove, but I'm not sure how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.
I'm thinking that I have to create a separate report for each "view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?
Thanks -
sara
The code may execute by you still have an error, Step though the code, I
would bet that frmPrintReports.fraOBReports in your Case statement is
Null
or undefined. As for using a seperate report for each view, you logic
looks
OK for changing sort order. Get the code working and one report should
handle you needs.- Hide quoted text -
- Show quoted text -
I have checked as you suggested, and all is well.
I put "Break on all errors" - no errors
I stepped through the code - no errors; it follows as I would expect.
I checked the value of fraOBReports in the selectcase statements, and
it was "5" both times.
Any other ideas?
thanks -
sara

Is the code in the Report Open event?- Hide quoted text -

- Show quoted text -
Yes.

Should it be?

Sara

May 19 '07 #7

P: n/a

"sara" <sa*******@yahoo.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On May 18, 12:30 pm, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message

news:11*********************@y80g2000hsf.googlegro ups.com...


On May 18, 8:58 am, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the
code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your
cases?
Also GroupLevel() numbers change as you add and remove groups.
"sara" <saraqp...@yahoo.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Hi -
I have looked at all posts and tried both Allen Browne's
Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the
sort
Order.
The second works, but since I can't use Sorting and Grouping,
I
can't
get totals that I need.
The first works in one App, but does not work now. Any idea
why?
When I run for any option, I get the OutboundDate as the first
Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm
seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled
by
Trailer)
Perhaps I should be writing a separate report with the desired
sort
and totals? I'm not sure - I know I could use just the one
query,
but
I'm trying to be efficient, if possible. I have the feeling
it's
because I have header, totals in some footers and blanks in
others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -
- Show quoted text -
There are no errors; code all executes and report is displayed.
I know the headers change as you add and remove, but I'm not sure
how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.
I'm thinking that I have to create a separate report for each
"view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?
Thanks -
sara
The code may execute by you still have an error, Step though the
code, I
would bet that frmPrintReports.fraOBReports in your Case statement
is
Null
or undefined. As for using a seperate report for each view, you
logic
looks
OK for changing sort order. Get the code working and one report
should
handle you needs.- Hide quoted text -
- Show quoted text -
I have checked as you suggested, and all is well.
I put "Break on all errors" - no errors
I stepped through the code - no errors; it follows as I would expect.
I checked the value of fraOBReports in the selectcase statements, and
it was "5" both times.
Any other ideas?
thanks -
sara
Is the code in the Report Open event?- Hide quoted text -

- Show quoted text -

Yes.

Should it be?

Sara
Yes, at least that is where it is in my reports.

Your code looks reasonable, since the case statement is working an the right
Case executes, There must be a problem with the data or groups. Try
disabling the code then set the sorting manually to see if it works.
May 21 '07 #8

P: n/a
On May 21, 8:09 am, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
On May 18, 12:30 pm, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message
>news:11*********************@y80g2000hsf.googlegr oups.com...
On May 18, 8:58 am, "paii, Ron" <p...@packairinc.comwrote:
"sara" <saraqp...@yahoo.comwrote in message
>news:11**********************@o5g2000hsb.googlegr oups.com...
On May 15, 11:33 am, "paii, Ron" <p...@packairinc.comwrote:
Have you tried setting a break point and stepping though the
code.
1) Check for any errors like unknown field names ect.
2) Is Forms.frmPrintReports.fraOBReports returning one of your
cases?
Also GroupLevel() numbers change as you add and remove groups.
"sara" <saraqp...@yahoo.comwrote in message
>news:11**********************@h2g2000hsg.googlegr oups.com...
Hi -
I have looked at all posts and tried both Allen Browne's
Report
Sorting at run Time
( Select Case Forms!frmChooseSort!grpSort
Case 1 'Name
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName") .....
And another post that was OrderByOn = True and setting the
sort
Order.
The second works, but since I can't use Sorting and Grouping,
I
can't
get totals that I need.
The first works in one App, but does not work now. Any idea
why?
When I run for any option, I get the OutboundDate as the first
Sort/
Group, Followed by Trailer #.
So, when for Case 5 I want Whse, Location, then Date, I'm
seeing:
Whse 3
Date
Trailer #
Dept (Details, grouped by location, but totaled
by
Trailer)
Perhaps I should be writing a separate report with the desired
sort
and totals? I'm not sure - I know I could use just the one
query,
but
I'm trying to be efficient, if possible. I have the feeling
it's
because I have header, totals in some footers and blanks in
others.
But I'd love confirmation or correction on this.
Thanks -
sara
Code:
Select Case Forms.frmPrintReports.fraOBReports
Case 1
' Default Report Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 2
' Default Sort: Whse, Date, Trailer#
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(2).ControlSource = "TrailerNum"
Me.GroupLevel(3).ControlSource = "CreditSalesTo"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 3
' Dept Sort: Whse, Date, Dept
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(2).ControlSource = "CreditSalesTo"
Me.GroupLevel(1).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "LocationKey"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
GoTo Exit_Report_Open
Case 4
' Goods Type Sort: Whse, GoodsType, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "GoodsType"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "LocationKey"
GoTo Exit_Report_Open
Case 5
' Location Sort: Whse, Location, Date
Me.GroupLevel(0).ControlSource = "WhseKey"
Me.GroupLevel(1).ControlSource = "LocationKey"
Me.GroupLevel(2).ControlSource = "OutboundDate"
Me.GroupLevel(3).ControlSource = "TrailerNum"
Me.GroupLevel(4).ControlSource = "CreditSalesTo"
Me.GroupLevel(5).ControlSource = "GoodsTypeKey"
'
GoTo Exit_Report_Open
End Select
(Error handling here)- Hide quoted text -
- Show quoted text -
There are no errors; code all executes and report is displayed.
I know the headers change as you add and remove, but I'm not sure
how
that impacts what I'm doing?? I put these from 0 ot 5 in the order
that I want the data displayed.
I'm thinking that I have to create a separate report for each
"view"
that the users see. I am trying to "reuse" everywhere I can, but
maybe I can't here?
Thanks -
sara
The code may execute by you still have an error, Step though the
code, I
would bet that frmPrintReports.fraOBReports in your Case statement
is
Null
or undefined. As for using a seperate report for each view, you
logic
looks
OK for changing sort order. Get the code working and one report
should
handle you needs.- Hide quoted text -
- Show quoted text -
I have checked as you suggested, and all is well.
I put "Break on all errors" - no errors
I stepped through the code - no errors; it follows as I would expect.
I checked the value of fraOBReports in the selectcase statements, and
it was "5" both times.
Any other ideas?
thanks -
sara
Is the code in the Report Open event?- Hide quoted text -
- Show quoted text -
Yes.
Should it be?
Sara

Yes, at least that is where it is in my reports.

Your code looks reasonable, since the case statement is working an the right
Case executes, There must be a problem with the data or groups. Try
disabling the code then set the sorting manually to see if it works.- Hide quoted text -

- Show quoted text -
I'll try this - I'm out for a few weeks, but may get to it while out.
Otherwise, I'll post when I've tried it.
Thanks

May 22 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.