B
Bonnie A
Hi everyone. Using A02 on XP.
I have some code provided by an old post but need help with the
TransferSpreadsheet line. Here is my code so far:
Function ExportFileForEachGP()
Dim strSQL As String
Dim GRPID As Integer
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb
Set rs = db.OpenRecordset("qListGPs")
rs.MoveFirst
Do Until rs.EOF
GRPID = rs("GRPID")
strSQL = "Select * from tVtgAssetAcctBals WHERE GRPID = " & GRPID
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
tVtgAssetAcctBals, "S:\RPS\PTS\VtgAssetAcctBalExtract\" & [GRPID] & "_" &
Format(Date, "MM-DD-YY") & ".XLS"
rs.MoveNext
Loop
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Function
I get Run time error 3495: The action or method requires a Table Name argument
This line is highlighted:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
tVtgAssetAcctBals, "S:\RPS\PTS\VtgAssetAcctBalExtract\" & [GRPID] & "_" &
Format(Date, "MM-DD-YY") & ".XLS"
I have the table name in there and it seems to be in the right place...I was
pretty much guessing on the argument items after each comma.
If you can assist me with this final line, I think I can get this baby
running. It is going to save hundred of hours every quarter!!!
Thanks in advance for any assistance you may be able to provide!
Bonnie
I have some code provided by an old post but need help with the
TransferSpreadsheet line. Here is my code so far:
Function ExportFileForEachGP()
Dim strSQL As String
Dim GRPID As Integer
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb
Set rs = db.OpenRecordset("qListGPs")
rs.MoveFirst
Do Until rs.EOF
GRPID = rs("GRPID")
strSQL = "Select * from tVtgAssetAcctBals WHERE GRPID = " & GRPID
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
tVtgAssetAcctBals, "S:\RPS\PTS\VtgAssetAcctBalExtract\" & [GRPID] & "_" &
Format(Date, "MM-DD-YY") & ".XLS"
rs.MoveNext
Loop
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Function
I get Run time error 3495: The action or method requires a Table Name argument
This line is highlighted:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
tVtgAssetAcctBals, "S:\RPS\PTS\VtgAssetAcctBalExtract\" & [GRPID] & "_" &
Format(Date, "MM-DD-YY") & ".XLS"
I have the table name in there and it seems to be in the right place...I was
pretty much guessing on the argument items after each comma.
If you can assist me with this final line, I think I can get this baby
running. It is going to save hundred of hours every quarter!!!
Thanks in advance for any assistance you may be able to provide!
Bonnie