But, Lady, that's not "code", it's just a trivial expression
in one line of the Sorting and Grouping window. The second
one is just a field name selected from the field/expression
drop down list. It sounds like you may be unfamiliar with
using Sorting and Grouping (View menu). If so, take a
little time out from making extra work for yourself and get
familiar with this powerful, but easy to use feature of
Access reports. Then give my earlier suggestion a try.
Note that, unlike forms, anything beyond a trivial report
**must** use Sorting and Grouping to specify it's sorting.
Changing this according to user input requires a small
amount of real VBA code. If your up to it, post back with
specific details for a specific report and I'll provide some
code for you to try.
As to your other question, you can use a slightly more
complex expression (not code) to cause your form's record
source **query** to be sorted in either of two ways. First,
some form's control (text box, check box, combo box, etc)
should be used to allow the users to specify which sort they
want. Since you didn't provide much in the way of clues to
your requirements, I can only provide the general idea.
Add a calculated field to the query:
SortVal:IIf(Forms!someform.somecontrol = val1,fieldA,fieldB)
--
Marsh
MVP [MS Access]
Crazy said:
Thanks for replying Marshall. I don't think this helps me, because I don't
know how to use code. I only have one piece of code in my database so far,
and that was given to me on this site.
If you wouldn't mind eleborating I would be very grateful.
You may be able to help further. I am wanting to sort in a report mainly,
but possibly also in a form and there are two possible sort criteria. I may
want to sort by this field or by another. I was intending to create two
reports sorted in those two ways and have a prompt ask which report to show.
Is there a better way?