Solved

access questions

Posted on 2014-12-03
3
60 Views
Last Modified: 2016-07-11
1)what is staging table?
2) how do i write a vba code with that import an excel file into a table with a message box "import was succesfull"?
0
Comment
Question by:akinamon1
[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
3 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 250 total points
ID: 40480154
1) A table is a SQL used when importing external data. It isn't an Access feature or concept.
2) That very much depends on the scenario, here is some generic code which should get you started:

Sub Demo

        Dim strFile As String
        Dim strTable As String
        Dim blnHasFieldNames As Boolean

        ' Change this next line to True if the first row in EXCEL worksheet
        ' has field names
        blnHasFieldNames = False

        ' Replace tablename with the name of the destination table name
        strTable = "tablename"

        ' Change C:\Temp\Temp.xlsx with the full file name and path of the Excel file
        strFile = "C:\Temp\Temp.xlsx"

        DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, strTable, strPathFile, blnHasFieldNames

End Sub

Open in new window

0
 
LVL 51

Assisted Solution

by:Gustav Brock
Gustav Brock earned 250 total points
ID: 40480229
1. A sort of temporary table. In most cases, you won't have a need for it.

2. Often the best method is not to import the Excel data but link them. Then create a simple select query that pulls the data from the linked table and performs basic filtering for empty records/fields and conversion (like converting text fields to numeric or date) which you would use in any case where these data will be used in your application. Also, alias can be applied to field names, indeed where you have none and the have received the default F1, F2, etc.

Now, use the query from #2 as the source whenever you need to pull data from the Excel file.

/gustav
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

627 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