T
TheNovice
I am using the VB within Access. I have the general idea but I am lost and
dont want to use a Macro. I have a list of about 209 sales people and I need
to extract data to create an excel spread sheet for each of them. the
problem that I have is that I need it to run for all of the sales people and
create a spread sheet with there numbers plus the ".XLS"
I have three things going:
Table: tblFinalPhase234 (This has all of the information for the spread sheet)
Form: The source of the form is the list of all sales people. with a button
that will run the module.
Query (Make Table: tblMATable): This will create the table that will be used
for the Excel Spread Sheet.
Here is my code.
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String
Dim ma As Form_MaForm
stDocName = "qryBuildMaTable"
DoCmd.OpenQuery stDocName, acNormal, acEdit
If ma = "s010" Then
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
MaTable, "C:\commun\MAS010.xls", True
Else
End If
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
dont want to use a Macro. I have a list of about 209 sales people and I need
to extract data to create an excel spread sheet for each of them. the
problem that I have is that I need it to run for all of the sales people and
create a spread sheet with there numbers plus the ".XLS"
I have three things going:
Table: tblFinalPhase234 (This has all of the information for the spread sheet)
Form: The source of the form is the list of all sales people. with a button
that will run the module.
Query (Make Table: tblMATable): This will create the table that will be used
for the Excel Spread Sheet.
Here is my code.
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String
Dim ma As Form_MaForm
stDocName = "qryBuildMaTable"
DoCmd.OpenQuery stDocName, acNormal, acEdit
If ma = "s010" Then
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
MaTable, "C:\commun\MAS010.xls", True
Else
End If
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub