mscertified said:
My record source is passed to my report in openargs and I need to dynamically
set sorting and grouping in code.
Is this possible and if so, how?
You need to create the grouping entries and group
header/footers manually in design view.
You can then change the field/expression by using code in
the report's Open event:
Me.GroupLevel(x).RecordSource = "fieldname"
To effectively disable a sort/group, set it to a constant
expression:
Me.GroupLevel(x).RecordSource = "=0"
and make any group header/footer sections invisible.
Check VBA Help for details about the GroupLevel object.