A
AJ
I have a form in which I have a list and a button. On clicking the button and
making a selection from the list box, it imports all the data corresponding
to the selection and transfers the records into a spreadsheet. This is the
code:
Private Sub Create_Report_by_Mandate_Manager_Click()
On Error GoTo Err_Create_Report_by_Mandate_Manager_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Summary Report - Incompleted Mandates"
stLinkCriteria = "[Sr Mgr / Mgr]=" & "'" & Me![List0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, stDocName,
"C:\IncMandates\Mandates - " & CStr([List0]) & ".xls", True
Exit_Create_Report_by_Mandate_Manager_Cl:
Exit Sub
Err_Create_Report_by_Mandate_Manager_Click:
MsgBox Err.Description
Resume Exit_Create_Report_by_Mandate_Manager_Cl
End Sub
Now how do I generate a separate spreadsheet for every entry in the list by
one click of the button.
thanks.
making a selection from the list box, it imports all the data corresponding
to the selection and transfers the records into a spreadsheet. This is the
code:
Private Sub Create_Report_by_Mandate_Manager_Click()
On Error GoTo Err_Create_Report_by_Mandate_Manager_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Summary Report - Incompleted Mandates"
stLinkCriteria = "[Sr Mgr / Mgr]=" & "'" & Me![List0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, stDocName,
"C:\IncMandates\Mandates - " & CStr([List0]) & ".xls", True
Exit_Create_Report_by_Mandate_Manager_Cl:
Exit Sub
Err_Create_Report_by_Mandate_Manager_Click:
MsgBox Err.Description
Resume Exit_Create_Report_by_Mandate_Manager_Cl
End Sub
Now how do I generate a separate spreadsheet for every entry in the list by
one click of the button.
thanks.