I have two fields on a form. These two fields' values are based on an
expression and represent a date range. I need to create a SQL
statement that will use the returned values of these two fields in the
WHERE clause as a date range (less than or equal to, and greater than
or equal to the upper and lower dates of the range).
I then need to count the total number of records returned from the
query and output the record count to another text box on the same form
as the date range fields.
This seems like it should be easy but I am having problems and I can't
determine if it's my syntax for the query or if it's impossible to
call values from a text box directly for use in the WHERE clause.
Here is what I have played around with. I don't get an error when the
form runs. I just don't get a returned record count in my text box.
strTotalShips = "SELECT RMAs.*, RMAs.[QAreviewed Date] " & _
"From RMAs " & _
"Where RMAs.[QAreviewed Date] Between Me!
[txtWk1BegDate] AND Me![txtWk1EndDate]'; "
DoCmd.RunSQL strTotalShips
Me!txtWk1TotalS hips = strTotalShips
Thanks for the help in advance.
Troy Lee
expression and represent a date range. I need to create a SQL
statement that will use the returned values of these two fields in the
WHERE clause as a date range (less than or equal to, and greater than
or equal to the upper and lower dates of the range).
I then need to count the total number of records returned from the
query and output the record count to another text box on the same form
as the date range fields.
This seems like it should be easy but I am having problems and I can't
determine if it's my syntax for the query or if it's impossible to
call values from a text box directly for use in the WHERE clause.
Here is what I have played around with. I don't get an error when the
form runs. I just don't get a returned record count in my text box.
strTotalShips = "SELECT RMAs.*, RMAs.[QAreviewed Date] " & _
"From RMAs " & _
"Where RMAs.[QAreviewed Date] Between Me!
[txtWk1BegDate] AND Me![txtWk1EndDate]'; "
DoCmd.RunSQL strTotalShips
Me!txtWk1TotalS hips = strTotalShips
Thanks for the help in advance.
Troy Lee
Comment