Sort Report fields

  • Thread starter Thread starter CF
  • Start date Start date
C

CF

I posted in forms programming about a situation and I was
able to solve the problem that I needed for that.
However, I am at a crossroad on how to resolve this
problem. I have a form with 6 textboxes each with it's
text criteria. I also have a report that is sorted and
grouped by 4 fields (ID, Section, Category, Code). The
Category field I would like to be able to sort by the 6
texboxes displayed on the form. The report's record
source is from a table, but can easliy be changed to a
query. Can anyone assist me on how to do this? I looked
at http://members.iinet.net.au/~allenbrowne/ser-33.html
but I am not sure this helps me in solving my problem.

Thanks for any assistance
 
This is a follow up of my problem. I created a query
hoping to be able to get this to work. The CategorySort
appears in the report so I know the query works but for
some reason it is not being brought into the report
properly. It seems as if it is still being displayed
alphabetically. For instance if the third textbox is c
and the value is alphabetically first then on the report
it displays c but it should be displaying a which is the
first textbox. Here is my code for the query.

SELECT tblResults.*, Switch([category]=[forms]!
[frmCriteriaSequence].[txt1],"a",[category]=[forms]!
[frmCriteriaSequence].[txt2],"b",[category]=[forms]!
[frmCriteriaSequence].[txt3],"c",[category]=[forms]!
[frmCriteriaSequence].[txt4],"d",[category]=[forms]!
[frmCriteriaSequence].[txt5],"e",[category]=[forms]!
[frmCriteriaSequence].[txt6],"f") AS CategorySort
FROM tblResults
WHERE (((Switch([category]=[forms]![frmCriteriaSequence].
[txt1],"a",[category]=[forms]![frmCriteriaSequence].
[txt2],"b",[category]=[forms]![frmCriteriaSequence].
[txt3],"c",[category]=[forms]![frmCriteriaSequence].
[txt4],"d",[category]=[forms]![frmCriteriaSequence].
[txt5],"e",[category]=[forms]![frmCriteriaSequence].
[txt6],"f")) Is Not Null))
ORDER BY Switch([category]=[forms]![frmCriteriaSequence].
[txt1],"a",[category]=[forms]![frmCriteriaSequence].
[txt2],"b",[category]=[forms]![frmCriteriaSequence].
[txt3],"c",[category]=[forms]![frmCriteriaSequence].
[txt4],"d",[category]=[forms]![frmCriteriaSequence].
[txt5],"e",[category]=[forms]![frmCriteriaSequence].
[txt6],"f");
 
Never mind I got it to work.
For some reason who ever set this up has the section and
category being the same, one being a number the other the
name. So of course since the section was above the
category it sorted by it, first. Sorry about that I guess
I should have looked at it a little harder.
-----Original Message-----
This is a follow up of my problem. I created a query
hoping to be able to get this to work. The CategorySort
appears in the report so I know the query works but for
some reason it is not being brought into the report
properly. It seems as if it is still being displayed
alphabetically. For instance if the third textbox is c
and the value is alphabetically first then on the report
it displays c but it should be displaying a which is the
first textbox. Here is my code for the query.

SELECT tblResults.*, Switch([category]=[forms]!
[frmCriteriaSequence].[txt1],"a",[category]=[forms]!
[frmCriteriaSequence].[txt2],"b",[category]=[forms]!
[frmCriteriaSequence].[txt3],"c",[category]=[forms]!
[frmCriteriaSequence].[txt4],"d",[category]=[forms]!
[frmCriteriaSequence].[txt5],"e",[category]=[forms]!
[frmCriteriaSequence].[txt6],"f") AS CategorySort
FROM tblResults
WHERE (((Switch([category]=[forms]![frmCriteriaSequence].
[txt1],"a",[category]=[forms]![frmCriteriaSequence].
[txt2],"b",[category]=[forms]![frmCriteriaSequence].
[txt3],"c",[category]=[forms]![frmCriteriaSequence].
[txt4],"d",[category]=[forms]![frmCriteriaSequence].
[txt5],"e",[category]=[forms]![frmCriteriaSequence].
[txt6],"f")) Is Not Null))
ORDER BY Switch([category]=[forms]![frmCriteriaSequence].
[txt1],"a",[category]=[forms]![frmCriteriaSequence].
[txt2],"b",[category]=[forms]![frmCriteriaSequence].
[txt3],"c",[category]=[forms]![frmCriteriaSequence].
[txt4],"d",[category]=[forms]![frmCriteriaSequence].
[txt5],"e",[category]=[forms]![frmCriteriaSequence].
[txt6],"f");


-----Original Message-----
I posted in forms programming about a situation and I was
able to solve the problem that I needed for that.
However, I am at a crossroad on how to resolve this
problem. I have a form with 6 textboxes each with it's
text criteria. I also have a report that is sorted and
grouped by 4 fields (ID, Section, Category, Code). The
Category field I would like to be able to sort by the 6
texboxes displayed on the form. The report's record
source is from a table, but can easliy be changed to a
query. Can anyone assist me on how to do this? I looked
at http://members.iinet.net.au/~allenbrowne/ser-33.html
but I am not sure this helps me in solving my problem.

Thanks for any assistance
.
.
 
Back
Top