Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Access 97 importing


Message #1 by "Lesley Schulz" <lesley.schulz@h...> on Mon, 24 Sep 2001 21:31:58
If you have the following statment of code behind a buttion

DoCmd.TransferSpreadsheet acImport, 3, "Employees","C:\Lotus\Newemps.wk3", 

True, "A1:G12"



If you don't know the path of the file or the file name the user wants to 

import, what can you do?



Lesley
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Mon, 24 Sep 2001 14:20:54 -0700
Use the OpenFile dialog to get the file name from the user.  See



http://www.mvps.org/access/api/api0001.htm



for details.



HTH,



-Roy



Roy Pardee

Programmer/Analyst

SWFPAC Lockheed Martin IT

(xxx) xxx-xxxx



-----Original Message-----

From: Lesley Schulz [mailto:lesley.schulz@h...]

Sent: Monday, September 24, 2001 2:32 PM

To: Access

Subject: [access] Access 97 importing





If you have the following statment of code behind a buttion

DoCmd.TransferSpreadsheet acImport, 3, "Employees","C:\Lotus\Newemps.wk3", 

True, "A1:G12"



If you don't know the path of the file or the file name the user wants to 

import, what can you do?



Lesley
Message #3 by "John Ruff" <papparuff@c...> on Mon, 24 Sep 2001 15:01:40 -0700
Add the CommonDialog Activex control to your form (this code calls it

ocxCommonDialog). Then add the following code.



    With ocxCommonDialog

        .Filter = "All (*.*)|*.*"

        .ShowOpen

        If Len(.FileName) > 0 Then

             strFileName = .FileName

                 DoCmd.TransferSpreadsheet acImport, 3,

"Employees",.FileName, True, "A1:G12"

        End If

    End With

  



John Ruff - The Eternal Optimist :-) 



     

-----Original Message-----

From: Lesley Schulz [mailto:lesley.schulz@h...]

Sent: Monday, September 24, 2001 9:32 PM

To: Access

Subject: [access] Access 97 importing





If you have the following statment of code behind a buttion

DoCmd.TransferSpreadsheet acImport, 3,

"Employees","C:\Lotus\Newemps.wk3",

True, "A1:G12"



If you don't know the path of the file or the file name the user wants

to

import, what can you do?



Lesley


  Return to Index