A
Anand Vaidya
I know how to create a query using vba programatically. I don't know the
syntax to use this query and open the report.I tried something like this but
didn't work.Ofcourse it was a wild guess -
reports.rptSearchedRecords.RecordSource=qrySearchedRecords
(I want to put this code in the mainform frmReport's "Generate Report" click
event)
I want the syntax for assigning the query(qrySearchedRecords) as the
recordsource for the report(rptSearchedRecords)
some details-
frmReport - Main form
Subcontainer - sub form
rptSearchedRecords - Report name
qrySearchedRecords - query string
I know that if there is a single search criteria , we can use the "where
condition" argument , something like this -
DoCmd.OpenReport "rptAll", acViewPreview, , "Received_Date
between #" & strfrom & "# and #" & strto & "#" ' order by [received_date]"
but I don't know how to assign the query to docmd.openreport() function(if
at all this is the right method)
syntax to use this query and open the report.I tried something like this but
didn't work.Ofcourse it was a wild guess -
reports.rptSearchedRecords.RecordSource=qrySearchedRecords
(I want to put this code in the mainform frmReport's "Generate Report" click
event)
I want the syntax for assigning the query(qrySearchedRecords) as the
recordsource for the report(rptSearchedRecords)
some details-
frmReport - Main form
Subcontainer - sub form
rptSearchedRecords - Report name
qrySearchedRecords - query string
I know that if there is a single search criteria , we can use the "where
condition" argument , something like this -
DoCmd.OpenReport "rptAll", acViewPreview, , "Received_Date
between #" & strfrom & "# and #" & strto & "#" ' order by [received_date]"
but I don't know how to assign the query to docmd.openreport() function(if
at all this is the right method)