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.