T
Tatakau
I have a button on [Form1] that opens up [Form2] when clicked, sending an ID
number as an argument. In the VB Code for [Form2], I have it set to sort all
records by ID number first, followed by a secondary sort by Tour numbers.
Here is the code:
Dim strSQL As String
If Not IsNull(Me.OpenArgs) Then
strSQL = "SELECT * FROM [QueryMVCScheduleandCommunications] ORDER BY
" & _
"IIF([LeadNumber] = " & Me.OpenArgs & ", 1, 2), TourNumber"
Me.RecordSource = strSQL
End If
However, I wish to reverse sort by TourNumber. Thus, if someone (identified
by an ID (Lead) number) has multiple tours, the larger TourNumber (and thus,
the most recent tour) will come up first.
Thank you!
Nick
Example:
Current Desired
ID TourNum ID TourNum
1 34 1 46
1 46 1 34
2 23 2 23
3 35 3 35
4 63 4 67
4 67 4 63
number as an argument. In the VB Code for [Form2], I have it set to sort all
records by ID number first, followed by a secondary sort by Tour numbers.
Here is the code:
Dim strSQL As String
If Not IsNull(Me.OpenArgs) Then
strSQL = "SELECT * FROM [QueryMVCScheduleandCommunications] ORDER BY
" & _
"IIF([LeadNumber] = " & Me.OpenArgs & ", 1, 2), TourNumber"
Me.RecordSource = strSQL
End If
However, I wish to reverse sort by TourNumber. Thus, if someone (identified
by an ID (Lead) number) has multiple tours, the larger TourNumber (and thus,
the most recent tour) will come up first.
Thank you!
Nick
Example:
Current Desired
ID TourNum ID TourNum
1 34 1 46
1 46 1 34
2 23 2 23
3 35 3 35
4 63 4 67
4 67 4 63