Solved

File open Prompt Using in VBA

Posted on 2006-06-13
10
315 Views
Last Modified: 2008-02-20

I want to import a spreadsheet into a microsoft access table. I need a typical windows file open prompt to appear so the user can choose the file they wish to import and once selected inport the spreadsheet into a table

Can anyone help me with this?
0
Comment
Question by:oogooglies
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 16895056
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16895058
pick the 2nd one
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 16895074
Download free demo and source code "Browse and Open Files" at this link:

                  http://www.candace-tripp.com/pages/access_downloads.aspx#8
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 34

Expert Comment

by:jefftwilley
ID: 16895256
I've been assisting another with your same intentl...might be helpful
http://www.experts-exchange.com/Databases/MS_Access/Q_21882261.html#16895169
J
0
 

Author Comment

by:oogooglies
ID: 16897882
rockiroads, thanks that is exactly what i needed. The next step is to use the file selected and import it into a table within the access database... how would i go about doing that?
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 16897888
Check the link I pasted...that's exactly what I'm helping him do.
J
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 250 total points
ID: 16897985
When u call CreateDialog, it returns the filename selected

imagine the value returned is held in a variable called sFile

to import that sFile being a delimited file, with headers (last parameter)

DoCmd.TransferText acImportDelim, , "tablename", sFile, True

0
 

Author Comment

by:oogooglies
ID: 16898189
Thanks for your help, i have just got there before refreshing... slightly differently but basically the same....
0
 

Author Comment

by:oogooglies
ID: 16898200
Thanks jefftwilley, but rockiroads solution fits the bill perfectly. Cheers for your help
0
 

Author Comment

by:oogooglies
ID: 16900750
rockiroads,

Can a similar dialogbox be used to save data selected from a query into a file..... Again so i acts and feels like windows?

Thanks

Anthony
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

825 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