D
desprate
this is my case: i have a query and a form and a VBA code that excutes when a
button is clicked on the form and exports the data from the query into a text
file.
the problem is that on the form i have to input a start and end date so that
the query results will be limited by the period given.
the question is: how do i tell my vba code the dates that i have entered
through the form so that it will add them to the sql query in the "where"
clause?
this is the part of my code that is causing trouble:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("myquery") <-----this is where it's going wrong
and asking for the parameters.
i use the recordset to hold the results of the query while exporting to the
file.
Hope you can help me because it's really important
Thank you
button is clicked on the form and exports the data from the query into a text
file.
the problem is that on the form i have to input a start and end date so that
the query results will be limited by the period given.
the question is: how do i tell my vba code the dates that i have entered
through the form so that it will add them to the sql query in the "where"
clause?
this is the part of my code that is causing trouble:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("myquery") <-----this is where it's going wrong
and asking for the parameters.
i use the recordset to hold the results of the query while exporting to the
file.
Hope you can help me because it's really important
Thank you