lemon_balm
Registered User.
- Local time
- Today, 00:54
- Joined
- Feb 7, 2006
- Messages
- 65
Hi
I have created a combo box with some underlying code to filter the results on my form by a specific field.
In other words, I select a field from the list and the form is set to sort ascending by this selection. Well, that's what I would lilke it to do anyway. To do this I have been looking at using the OrderBy keyword but it doesn't seem to work. Does anyone know which keyword I should be using to make this function correctly?
Code:
Private Sub cboSortby_AfterUpdate()
Dim choice As String
choice = forms!frmoutershell.frminnershell.Form.cboSortby.Value
If choice = "date" Then
forms!frmoutershell.frminnershell.frminnerinnershell.OrderBy "calldate"
Else
If choice = "Time" Then
forms!frmoutershell.frminnershell.OrderBy "calltime"
Else
If choice = "Issue" Then
forms!frmoutershell.frminnershell.OrderBy "callissue"
Else
If choice = "caller Name" Then
forms!frmoutershell.frminnershell.OrderBy "callername"
Else
If choice = "Passed To" Then
forms!frmoutershell.frminnershell.OrderBy "username"
Else
If choice = "CallID" Then
forms!frmoutershell.frminnershell.OrderBy "callID"
Else
If choice = "Caller Department" Then
forms!frmoutershell.frminnershell.OrderBy "calldept"
End If
End If
End If
End If
End If
End If
End If
End Sub
Regards
Jason
I have created a combo box with some underlying code to filter the results on my form by a specific field.
In other words, I select a field from the list and the form is set to sort ascending by this selection. Well, that's what I would lilke it to do anyway. To do this I have been looking at using the OrderBy keyword but it doesn't seem to work. Does anyone know which keyword I should be using to make this function correctly?
Code:
Private Sub cboSortby_AfterUpdate()
Dim choice As String
choice = forms!frmoutershell.frminnershell.Form.cboSortby.Value
If choice = "date" Then
forms!frmoutershell.frminnershell.frminnerinnershell.OrderBy "calldate"
Else
If choice = "Time" Then
forms!frmoutershell.frminnershell.OrderBy "calltime"
Else
If choice = "Issue" Then
forms!frmoutershell.frminnershell.OrderBy "callissue"
Else
If choice = "caller Name" Then
forms!frmoutershell.frminnershell.OrderBy "callername"
Else
If choice = "Passed To" Then
forms!frmoutershell.frminnershell.OrderBy "username"
Else
If choice = "CallID" Then
forms!frmoutershell.frminnershell.OrderBy "callID"
Else
If choice = "Caller Department" Then
forms!frmoutershell.frminnershell.OrderBy "calldept"
End If
End If
End If
End If
End If
End If
End If
End Sub
Regards
Jason