SteveL13
asked on
How sort records in a subreport based on the selection in a combobox on a form
Is there a way to sort the records in the detail section of a subreport based on the selection in a combobox on a form.
There are three choices: Category, Location , and Room. Each of this is a field in the query which is the reports recordsource.
I don't know if some code in the onopen event of the report would work?
--Steve
There are three choices: Category, Location , and Room. Each of this is a field in the query which is the reports recordsource.
I don't know if some code in the onopen event of the report would work?
--Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Note too that sorting is impacted by Groups as well - so if you're Grouping by FieldA but tell Access to Sort by FieldB, then your records would show on the form "sorted" for FieldA, and for each of those Groups, the records would then be "sorted" by FieldB.
ASKER
Boag2000,
I mistakenly accepted your suggestion before I realized that I could not download your example. Could you report it for me please?
--Steve
I mistakenly accepted your suggestion before I realized that I could not download your example. Could you report it for me please?
--Steve
<I could not download your example. >
Could not download it, ...or could not open it...?
In any event here it is again, in access 2003 mdb format
Could not download it, ...or could not open it...?
In any event here it is again, in access 2003 mdb format
here
Database222.mdb
Database222.mdb
Steve,
Note that I used the recordsource here.
What the other experts posted about using the OrderBy Property is the more used technique.
For whatever reason, I was having trouble with Ordeby in a SubReport, (opened by a form)
So my old fallback is to just grab the Recordsouce and sort that instead.
What this meas is that you ever add a sort in the report itself, the recordsouce sort will be ignored (as Jim States)
Finally note that this may all change if your report includes grouping levels.
So play around with this and also play around with Ordeby.
again, I can think of about half a dozen approaches to this...
JeffCoachman
Note that I used the recordsource here.
What the other experts posted about using the OrderBy Property is the more used technique.
For whatever reason, I was having trouble with Ordeby in a SubReport, (opened by a form)
So my old fallback is to just grab the Recordsouce and sort that instead.
What this meas is that you ever add a sort in the report itself, the recordsouce sort will be ignored (as Jim States)
Finally note that this may all change if your report includes grouping levels.
So play around with this and also play around with Ordeby.
again, I can think of about half a dozen approaches to this...
JeffCoachman
Jim.