Hi
How do I open a report and set the Orderby property.
Here is the code that opens my report, now I want to sort by 'TLsurname'
I thought I would just be able to add the order by on at the end of the docmd string but can't get it to work.
What I have found is the following
Me.GroupLevel(0).ControlSource = "[TLSurname] & ' ' & [TLForename]"
Me.GroupLevel(0).SortOrder = 0
This does work but can it be done in the docmd string.
Cheers
Kev
P.S. Don't want to waste anyones time as I have found a solution, just not sure its the best one.
How do I open a report and set the Orderby property.
Code:
DoCmd.OpenReport "rptColleagueByTeam", acViewPreview, "qryColleagues", "[Shift]='" & strshift & "'"
Here is the code that opens my report, now I want to sort by 'TLsurname'
I thought I would just be able to add the order by on at the end of the docmd string but can't get it to work.
What I have found is the following
Me.GroupLevel(0).ControlSource = "[TLSurname] & ' ' & [TLForename]"
Me.GroupLevel(0).SortOrder = 0
This does work but can it be done in the docmd string.
Cheers
Kev
P.S. Don't want to waste anyones time as I have found a solution, just not sure its the best one.