Hi.
> I have a two part question. I need to manipulate a table name a bit and then
> export it into a CSV file on my hardrive.
Try the following code to rename the existing table, then export it to a CSV
file (including field names as headers):
' * * * * Start Code * * * *
Private Sub ExportTblBtn_Click()
On Error GoTo ErrHandler
Dim sToday As String
sToday = Format(Date, "mmddyyyy")
DoCmd.Rename sToday, acTable, "tblA"
DoCmd.TransferText acExportDelim, , sToday, "C:\mytbls\" & sToday &
".csv", True
Exit Sub
ErrHandler:
MsgBox "Error in ExportTblBtn_Click( ) in" & vbCrLf & Me.Name & _
" form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear
End Sub
' * * * * End Code * * * *
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.
> Good morning:
>
[quoted text clipped - 27 lines]
>
> End Sub
pepenacho - 31 Mar 2005 20:21 GMT
Looks nice, I'll give it a whirl.
Thank you.
Pepe
> Hi.
>
[quoted text clipped - 79 lines]
> >
> > End Sub