N
nam81
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!B1395"
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.
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!B1395"
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.