File open Prompt Using in VBA


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?
oogoogliesAsked:
Who is Participating?
 
rockiroadsConnect With a Mentor Commented:
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
 
rockiroadsCommented:
pick the 2nd one
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
puppydogbuddyCommented:
Download free demo and source code "Browse and Open Files" at this link:

                  http://www.candace-tripp.com/pages/access_downloads.aspx#8
0
 
jefftwilleyCommented:
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
 
oogoogliesAuthor Commented:
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
 
jefftwilleyCommented:
Check the link I pasted...that's exactly what I'm helping him do.
J
0
 
oogoogliesAuthor Commented:
Thanks for your help, i have just got there before refreshing... slightly differently but basically the same....
0
 
oogoogliesAuthor Commented:
Thanks jefftwilley, but rockiroads solution fits the bill perfectly. Cheers for your help
0
 
oogoogliesAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.