G
Guest
I have created a form (frmFileIndex) that shows the user a listing of “File
Index Numbers†and associated “File Namesâ€. Above each of these two fields,
I have placed a command button that allows the user to sort on either column.
This provides a numeric looking listing (sorting by “File Index Numberâ€) or
an alphabetized listing (sorting by “File Nameâ€). A third command button is
placed on this form that allows the user to print out a report of the File
Index table (rptFileIndex).
Can anyone provide me with some assistance in coding that would have the
report print out in the sorted order selected by the user above. My failed
attempts had me trying coding that would look like this below, but can’t seem
to get it to work:
Private Sub Report_Open(Cancel As Integer)
If Forms![frmFileIndex]!Sort_by_File_Name Then
strOrder = "strFileNumber"
Else
strOrder = "strFileName"
End If
Me.OrderBy = strOrder
Me.OrderByOn
End Sub
Any help would be greatly appreciated,
Coleman
Index Numbers†and associated “File Namesâ€. Above each of these two fields,
I have placed a command button that allows the user to sort on either column.
This provides a numeric looking listing (sorting by “File Index Numberâ€) or
an alphabetized listing (sorting by “File Nameâ€). A third command button is
placed on this form that allows the user to print out a report of the File
Index table (rptFileIndex).
Can anyone provide me with some assistance in coding that would have the
report print out in the sorted order selected by the user above. My failed
attempts had me trying coding that would look like this below, but can’t seem
to get it to work:
Private Sub Report_Open(Cancel As Integer)
If Forms![frmFileIndex]!Sort_by_File_Name Then
strOrder = "strFileNumber"
Else
strOrder = "strFileName"
End If
Me.OrderBy = strOrder
Me.OrderByOn
End Sub
Any help would be greatly appreciated,
Coleman