N
nanoenterprises
I have a form combo box that filters a query. However when it exports
the results of the query to excel, only the header is shown. I have a
feeling that the export function doesn't wait for the query to finish
before exporting. I've been reading all over and found similar issues,
but can't seem to resolve this problem. Any assistance is greatly
appreciated.
Event procedure:
Private Sub ACPSelect_Change()
DoCmd.OpenQuery "qry for Assistant CP"
Me.ACPSelect = ""
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry for
Assistant CP", "Z:\Region1\Rates for Assistant CP " & Format(Date,"mm-
dd-yy") & ".xls", True, , True
DoCmd.Close acQuery, "qry Rates for Assistant CP", acSaveNo
End Sub
the results of the query to excel, only the header is shown. I have a
feeling that the export function doesn't wait for the query to finish
before exporting. I've been reading all over and found similar issues,
but can't seem to resolve this problem. Any assistance is greatly
appreciated.
Event procedure:
Private Sub ACPSelect_Change()
DoCmd.OpenQuery "qry for Assistant CP"
Me.ACPSelect = ""
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry for
Assistant CP", "Z:\Region1\Rates for Assistant CP " & Format(Date,"mm-
dd-yy") & ".xls", True, , True
DoCmd.Close acQuery, "qry Rates for Assistant CP", acSaveNo
End Sub