I am trying to add an 'ORDER BY' clause to my code with no success. The code is as follows,
Code:
Private Sub RequeryForm()
Dim W As String
Dim S As String
W = ""
If Not IsNull(StartDate) Then
If W <> "" Then W = W & " AND "
W = W & "EventDay >= #" & StartDate & "#"
End If
If Not IsNull(EndDate) Then
If W <> "" Then W = W & " AND "
W = W & "EventDay <= #" & EndDate & "#"
Me.lblTimer.Caption = "All Items"
End If
If IsTimer = True Then
If W <> "" Then W = W & " AND "
W = W & "Timer = True"
Me.lblTimer.Caption = "On Timer"
ElseIf IsTimer = False Then
If W <> "" Then W = W & " AND "
W = W & "Timer = False"
Me.lblTimer.Caption = "Off Timer"
End If
S = "Select * FROM CalendarTbl"
If W <> "" Then S = S & " WHERE " & W
Me.RecordSource = S
End Sub
I would like to add Order By [EventDay] but every thing I has tried so far has not worked. Any ideas would be wonderful.
Thanks
Jim O