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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top