Using a form with 2 Text boxes, one for Start Date and the other for End Date and a Command button, I wish to sort and view all records when I press the command button after the start and finish dates are entered into the text boxes associated with the query. I would do this using the on click event of the command button. I have included some code that does not work. As I am not sure how to do this I would appreciate some assistance.
[T_FinalData] is the table and [DateWorkDone] is the field in the table.
Private Sub Command34_Click()
Dim SQLst, Sdate, Edate
Sdate = Text30
Edate = Text32
SQLst = "SELECT [DateWorkDone] FROM [T_FinalData]" & "WHERE [Sdate] >= DateWorkDone And [End Date]<= DateWorkDone "
End Sub
kevsim
[T_FinalData] is the table and [DateWorkDone] is the field in the table.
Private Sub Command34_Click()
Dim SQLst, Sdate, Edate
Sdate = Text30
Edate = Text32
SQLst = "SELECT [DateWorkDone] FROM [T_FinalData]" & "WHERE [Sdate] >= DateWorkDone And [End Date]<= DateWorkDone "
End Sub
kevsim