G
Guest
I am trying to sort entries based off of arguments passed into a form (tours)
by another form (customers) with SQL. When the form opens, it should sort by
matching customer IDs first, with a secondary descending sort by a Last
Edited field in the Tours form.
I found some SQL that I've been trying to tweak. No luck so far:
Private Sub Form_Open(Cancel As Integer)
'Dim strSQL As String
'If Not IsNull(Me.OpenArgs) Then
'strSQL = "SELECT * FROM [tours] ORDER BY " & "IIF([leadnum] = " &
Me.OpenArgs & ", leadnum, 2), tournum"
'Me.RecordSource = strSQL
'End If
End Sub
Thanks,
Nick
by another form (customers) with SQL. When the form opens, it should sort by
matching customer IDs first, with a secondary descending sort by a Last
Edited field in the Tours form.
I found some SQL that I've been trying to tweak. No luck so far:
Private Sub Form_Open(Cancel As Integer)
'Dim strSQL As String
'If Not IsNull(Me.OpenArgs) Then
'strSQL = "SELECT * FROM [tours] ORDER BY " & "IIF([leadnum] = " &
Me.OpenArgs & ", leadnum, 2), tournum"
'Me.RecordSource = strSQL
'End If
End Sub
Thanks,
Nick