Hey Peeps,
I have a form in Microsoft access with some fields and checkboxes with a Search Button. On filling in the fields and ticking the check boxes, it creates a query on the fly and displays it as a report. This all works fine but I want to add an extra button on the form that would create the same query (based on what users click on the form) and then export it to excel. Can anyone guide me on how to do this?
Here is the code in VB for when the query runs and opens the results in a report:
How do I run the same query and export it to excel?
Thanks,
Ket
I have a form in Microsoft access with some fields and checkboxes with a Search Button. On filling in the fields and ticking the check boxes, it creates a query on the fly and displays it as a report. This all works fine but I want to add an extra button on the form that would create the same query (based on what users click on the form) and then export it to excel. Can anyone guide me on how to do this?
Here is the code in VB for when the query runs and opens the results in a report:
Code:
CurrentDb.QueryDefs("qryExamTake_Two").SQL = strSQL
DoCmd.OpenReport "frmExamDetails", acViewPreview
Thanks,
Ket