Solved

How do you change the Name of a table when you change to a excel table?

Posted on 2013-10-23
1
384 Views
Last Modified: 2013-10-23
I am transferring a table to excel format and then it goes to a folder on the c drive.
How do I automatically change the name of the excel spreadsheet once it is converted to excel?

Dim strTable1Name1        As String
Dim strBasePath             As String

strBasePath = "C:\InductionImport\"
strTable1Name1 = strBasePath & "tblFS3ResponsesSelected.xlsx"

DoCmd.TransferSpreadsheet acExport, , "tblFS3ResponsesSelected", strTable1Name1
MsgBox "Export Complete, Data is Now in InductionImport Folder!"

DoCmd.OpenQuery "qryDeletetblFS3ResponsesSelectedFromMain", acViewNormal, acEdit
MsgBox "Records Have Been deleted from Main table in Database!"

DoCmd.OpenQuery "qryDeletetblFS3ResponsesSelected", acViewNormal, acEdit
MsgBox "Records Have Been deleted from tblFS3ResponsesSelected!"
MsgBox "Select Record to Export !"
0
Comment
Question by:gigifarrow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39595037
you can change the name from this string

strTable1Name1 = strBasePath & "tblFS3ResponsesSelected.xlsx"

example

strTable1Name1 = strBasePath & "NewExcelName.xlsx"


or

strBasePath = "C:\InductionImport\"
strTable1Name1 = strBasePath & "tblFS3ResponsesSelected.xlsx"

after the export commands


if dir(strTable1Name1)<>"" then

name strTable1Name1 as strBasePath & "Newname.xlsx"

end if
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question