Hello,
I have a tasks database that I've setup and would like to be able to have a user input two dates (Datefrom and Dateto), click Submit, and provide the user with a query based on those dates from our task list table.
I have a home screen which has a button for "Tasks Due Between Two Dates" and it pops up a small form called DateRange that has a choose your date range, with one field "Datefrom" and another field "Dateto". It has a Submit button on it. I have input masking for the date fields so the user knows what format to input the dates as.
The table I want to be able to query off of is called "ITSD Self Assessment Tasks"
On click, I want to close the DateRange form, run the query and show the results.
I am completely lost as to how to pass the Datefrom and Dateto parameters chosen by the user through a query to the table.
here's the random gobbledegook I have so far for the on-click action for the Submit button. I know it's crap.:
Private Sub SubmitDates_Click()
Dim datefrom As Date
Dim Dateto As Date
Let datefrom = Me.datefrom.Value
Let Dateto = Me.Dateto.Value
strSQL = "SELECT * FROM [ITSD Self Assessment Tasks] WHERE [Due Date] <= Me.Dateto And [Due Date] >= Me.datefrom"
CurrentDb.Execute strSQL
End Sub
So, please, help!