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

HELP! order in a report

P: n/a
Hello there,
I am making a report using codes bellow (a part of):

-------------------------------

Select Case Forms![dlgOrder]!TopBoard

Dim strGetSQL As String

Case 1

strGetSQL = "SELECT TOP 10 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

Case 2

strGetSQL = "SELECT TOP 50 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL
Case 3

strGetSQL = "SELECT [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

End Select
----------------------------------------------

while Case 1 and Case 2 work very well, Case 3 has problem, yes, it does
return all records from [qryOrderInfo], but there is no order by [Quantity]
by descend.

what can be the problem? Any help will be very much appreciated. Thanks in
advance.
Paul
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Wed, 20 Oct 2004 21:49:00 GMT, Paul T. Rong wrote:
Hello there,

I am making a report using codes bellow (a part of):

-------------------------------

Select Case Forms![dlgOrder]!TopBoard

Dim strGetSQL As String

Case 1

strGetSQL = "SELECT TOP 10 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

Case 2

strGetSQL = "SELECT TOP 50 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

Case 3

strGetSQL = "SELECT [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

End Select

----------------------------------------------

while Case 1 and Case 2 work very well, Case 3 has problem, yes, it does
return all records from [qryOrderInfo], but there is no order by [Quantity]
by descend.

what can be the problem? Any help will be very much appreciated. Thanks in
advance.

Paul


It really doesn't matter what sort order you have in the report's
record source.
The only reliable report sort order is the one entered in the Report's
Sorting and Grouping dialog.
Click View + Sorting and Grouping

Enter the field(s) to be sorted there.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

P: n/a
Reports don't use the order of the recordset passed to them. You must use
the Sorting and Grouping dialog.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paul T. Rong" <et***@hotmail.com> wrote in message
news:g3******************@news.chello.at...
Hello there,
I am making a report using codes bellow (a part of):

-------------------------------

Select Case Forms![dlgOrder]!TopBoard

Dim strGetSQL As String

Case 1

strGetSQL = "SELECT TOP 10 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

Case 2

strGetSQL = "SELECT TOP 50 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL
Case 3

strGetSQL = "SELECT [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

End Select
----------------------------------------------

while Case 1 and Case 2 work very well, Case 3 has problem, yes, it does
return all records from [qryOrderInfo], but there is no order by [Quantity] by descend.

what can be the problem? Any help will be very much appreciated. Thanks in
advance.
Paul

Nov 13 '05 #3

P: n/a
Both you and Fredg helped me to solve this problem. Exactly, aftere I used
the Sorting and Grouping of the report, it works like a charm. Thanks.

Paul

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> 写入消息新闻
:ua********************@rogers.com...
Reports don't use the order of the recordset passed to them. You must use
the Sorting and Grouping dialog.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paul T. Rong" <et***@hotmail.com> wrote in message
news:g3******************@news.chello.at...
Hello there,
I am making a report using codes bellow (a part of):

-------------------------------

Select Case Forms![dlgOrder]!TopBoard

Dim strGetSQL As String

Case 1

strGetSQL = "SELECT TOP 10 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

Case 2

strGetSQL = "SELECT TOP 50 [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL
Case 3

strGetSQL = "SELECT [ProductName],[Quantity],[Amount] FROM
[qryOrderInfo] ORDER BY [qryOrderInfo]![Quantity] DESC;"
Me.RecordSource = strGetSQL

End Select
----------------------------------------------

while Case 1 and Case 2 work very well, Case 3 has problem, yes, it does
return all records from [qryOrderInfo], but there is no order by

[Quantity]
by descend.

what can be the problem? Any help will be very much appreciated. Thanks in advance.
Paul


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.