Transfer Spreadsheet Current Record

Joined
May 26, 2010
Messages
1
Reaction score
0
Greetings,

I am a beginning VBA programmer (I'm actually an accountant) and I am working on a new database.
So far it is going pretty well, but I am having a hard time referencing the current record.

I'm using the transferspeadsheet command to try to print out the current record into excel like so:

Private Sub Excel_Export_Click()
On Error GoTo Err_Excel_Export_Click

DoCmd.TransferSpreadsheet acExport, 8, "New Product", "Destination.xls", False, "Data", False
Dim stDocName As String

stDocName = "Excel Export"
DoCmd.RunMacro stDocName


Exit_Excel_Export_Click:
Exit Sub

Err_Excel_Export_Click:
MsgBox Err.Description
Resume Exit_Excel_Export_Click

End Sub

Everything works fine and well except for if there is more than one record in the table, of course.
What is the easiest way to do this? // Am I using an inappropriate method and is there a better function to do this export?

Thanking in advance,
Mark
 
Back
Top