H
hdfixitup
I am using one report to display info in various ways dependent upon which
field I select from an option box that calls a report using the case command.
I want to sort records in that field based upon my selected field. I can
only apply one sort order in the Sorting and Grouping properties, so I need a
line of code that runs as the report is opened, So far, I am using the
following:
If Forms![PrintReportsDialog]![Select Order Type] = 1 And
Forms![PrintReportsDialog].[Select Number Both] = 1 Then
DoCmd.OpenReport "rptOrder", ReportDest, ,
Eval("IIf(Forms![PrintReportsDialog]![Select List] Is Null,"""",""[OrderID] =
Forms![PrintReportsDialog]![Select List]"")")
Reports![rptOrder]![JNumber].Visible = False
Reports![rptOrder]![Number].Visible = True
End If
When the Number field is visible, I want to sort on that field in ascending
order...and likewise when the JNumber field is visible. Any suggestions
Thanks
field I select from an option box that calls a report using the case command.
I want to sort records in that field based upon my selected field. I can
only apply one sort order in the Sorting and Grouping properties, so I need a
line of code that runs as the report is opened, So far, I am using the
following:
If Forms![PrintReportsDialog]![Select Order Type] = 1 And
Forms![PrintReportsDialog].[Select Number Both] = 1 Then
DoCmd.OpenReport "rptOrder", ReportDest, ,
Eval("IIf(Forms![PrintReportsDialog]![Select List] Is Null,"""",""[OrderID] =
Forms![PrintReportsDialog]![Select List]"")")
Reports![rptOrder]![JNumber].Visible = False
Reports![rptOrder]![Number].Visible = True
End If
When the Number field is visible, I want to sort on that field in ascending
order...and likewise when the JNumber field is visible. Any suggestions
Thanks