Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2007

Tip: Looking for answers? Try searching our database.

Automated Importing from Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nam81 - 07 Mar 2007 18:15 GMT
Hi all-- I need a way for users to import records into a database from a
series of Excel files that, more likely than not, won't have consistent file
names.  I've found VBA code that will allow the user to pick out a file
through a dialog box, but I can't figure out how to actually allow the user
to start that process.  In other words, the user needs to call

---
strLocation = GetFile()

If Len(strLocation) > 0 Then
  DoCmd.TransferSpreadsheet acImport, _
     acSpreadsheetTypeExcel9, "Evaluations", _
     strLocation, False, "IT-Contracted!B13:D95"

   DoCmd.TransferSpreadsheet acImport, _
     acSpreadsheetTypeExcel9, "Evaluations", _
     strLocation, False, "IT-Contracted!F13:G95"
End If
---

where the function GetFile is defined in a module (and appears to work
correctly.)  How can I put the user in a position to call this code and
actually complete the TransferSpreadsheet operations?  I*was* a programmer in
a former life, but it was a while ago and I havealmost zero experience in VBA
syntax.
John Nurick - 07 Mar 2007 21:11 GMT
Usual way is to use a commandbutton on a form, and put the code in the
button's Click event procedure.

>Hi all-- I need a way for users to import records into a database from a
>series of Excel files that, more likely than not, won't have consistent file
[quoted text clipped - 21 lines]
>a former life, but it was a while ago and I havealmost zero experience in VBA
>syntax.

--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.