D
Daniel O'Neill
Hi, i am trying to filter a form using a combo box containing the
address of an outlet, where the user can select the outlet and then
enter 2 dates in seperate text boxes, the idea is that once the user
hits the command button the filter will select the outlet and display
all the rentals attached to that outlet in between those dates in a
seperate form called Outlet. I am having trouble with the SQL! here is
what i have been trying.....
Private Sub cmdSearch_Click()
Dim strForm As String
Dim strSQL As String
strForm = "Outlet"
strSQL = "OutletCity = " & Me![lstOutlet] & " And ("dateStart = "
& Form_RentalAgreement.[dateStart]) Between #" & Me![txtStart] & "#
And #" & Me![txtEnd] & "#"
DoCmd.OpenForm strForm, , , strSQL
End Sub
I am trying to read in the date from another form called
RentalAgreement, I realise i could probably do this with a query but
under the guidelines of the project i must use VBA, i would really
appreciate it if anyone has any info on this particular issue as i
have tried to research it but to no avail!
Thank you
Daniel
address of an outlet, where the user can select the outlet and then
enter 2 dates in seperate text boxes, the idea is that once the user
hits the command button the filter will select the outlet and display
all the rentals attached to that outlet in between those dates in a
seperate form called Outlet. I am having trouble with the SQL! here is
what i have been trying.....
Private Sub cmdSearch_Click()
Dim strForm As String
Dim strSQL As String
strForm = "Outlet"
strSQL = "OutletCity = " & Me![lstOutlet] & " And ("dateStart = "
& Form_RentalAgreement.[dateStart]) Between #" & Me![txtStart] & "#
And #" & Me![txtEnd] & "#"
DoCmd.OpenForm strForm, , , strSQL
End Sub
I am trying to read in the date from another form called
RentalAgreement, I realise i could probably do this with a query but
under the guidelines of the project i must use VBA, i would really
appreciate it if anyone has any info on this particular issue as i
have tried to research it but to no avail!
Thank you
Daniel