Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-10-23
1
Medium Priority
?
391 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

715 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