Solved

File open Prompt Using in VBA

Posted on 2006-06-13
10
298 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

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.

Join & Write a Comment

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now