Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-access > #10514
| From | "Phil" <phil@stantonfamily.co.uk> |
|---|---|
| Newsgroups | comp.databases.ms-access |
| Subject | Re: Trying to set sort order in a Select statement |
| Date | 2015-03-18 09:31 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <mebglp$cbp$1@speranza.aioe.org> (permalink) |
| References | <jv8hga5gvknuudpbqrnggdji6mp1t2n3pa@4ax.com> |
On 17/03/2015 22:02:12, KW wrote:
> Regarding Access 2010.
>
> I am trying to set a dynamic sort order in a subreport but am having
> problems.
> The Recordsource property of the subreport is blank
> I have an OnOpen event in my subreport that looks like this:
>
> If DLookup("[RateDisplay]", "[tlkpSystemDefaults]") = "DESCENDING"
> Then
> Me.RecordSource = "SELECT qrySubReservations.* FROM
> qrySubReservations ORDER BY qrySubReservations.ratesum DESC;"
> End If
> If DLookup("[RateDisplay]", "[tlkpSystemDefaults]") = "ASCENDING" Then
> Me.RecordSource = "SELECT qrySubReservations.* FROM
> qrySubReservations ORDER BY qrySubReservations.ratesum ASC;"
> End If
>
> In DEBUG, I know the above lines of code are being executed. However,
> the ORDER BY clause is not being considered. I have played with the
> Order By On Load Yes/No properties in both the report and subreport
> but nothing I do makes a difference.
>
> Any help would be appreciated. Thank you.
>
> -Kristin
>
I have seen this sort of thing before, and the cause has been that the
RecordSource is not blank. Check that if you open the subreport in Design
View that it is blank, and as an extra precaution, when you close the report,
explicitly set the RecordSource = ""
Phil
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Trying to set sort order in a Select statement KW <noemailaddress@....> - 2015-03-17 16:02 -0600
Re: Trying to set sort order in a Select statement "Phil" <phil@stantonfamily.co.uk> - 2015-03-18 09:31 +0000
Re: Trying to set sort order in a Select statement "Ron Paii" <None@none.com> - 2015-03-18 06:59 -0500
Re: Trying to set sort order in a Select statement KW <noemailaddress@....> - 2015-03-18 17:00 -0600
Re: Trying to set sort order in a Select statement "Phil" <phil@stantonfamily.co.uk> - 2015-03-19 10:09 +0000
Re: Trying to set sort order in a Select statement KW <noemailaddress@....> - 2015-03-19 12:19 -0600
Re: Trying to set sort order in a Select statement KW <noemailaddress@....> - 2015-03-24 14:34 -0600
Re: Trying to set sort order in a Select statement Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-03-18 06:32 -0700
csiph-web