473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Import File Path - How do I change the code

I am using the following

DoCmd.TransferText acImportDelim, "Specification", "Table", "C:\file.csv", No

And this works fine but I would like to have the user type in the path and have the code reference that field instead of the "C:\file.csv" that is in the code above.

I have tried a few items in place of it but it does not seem to be the correct syntax or the correct way to do it. Is there an easy way to accomplish this?

Thanks for any help.
Aug 20 '10 #1
2 3224
attached file demonstrates allowing user to pick the file they want to import.

Cheers
darren
Attached Files
File Type: zip SapFin.zip (91.3 KB, 211 views)
Aug 23 '10 #2
NeoPa
32,556 Expert Mod 16PB
I'm not really clear where your confusion lies. This is a simple case of replacing the literal text ("C:\file.csv") with a reference to the variable or control used.

Assume a form with a TextBox control, called txtFile, to allow the operator to enter the address of the file. Your code would be something like :
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.TransferText(acImportDelim, "Specification", "Table", Me.txtFile, False)
Aug 24 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Irmen de Jong | last post by:
Hello, I don't understand why the following doesn't work. What I want to do is dynamically import some generated Python code and I'm doing this using compile and exec'ing it in the dict of a new...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
6
by: Tim | last post by:
I am in the process of moving a site from one hosting company to another. This site is fairly large, with hundreds of asp files, each with multiple "include" statements. The new host has a...
3
by: Wayne Aprato | last post by:
I am using code kindly provided by the Access Web to capture a file path and insert it into a form. The relevant part of the code follows: Function GetOpenFile(Optional varDirectory As Variant,...
0
by: Arif | last post by:
MY crystal report is using Access database. At design time i set file path for report. But i want that i can change this path at runtime so that my report can connect to the same database on...
5
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
1
by: lorirobn | last post by:
Hi, I have been manually importing a text file on a weekly basis to an Access table. The data on one field is about to change (happens to be the first field). It was numeric, and is defined as...
2
by: mpalomas | last post by:
Hi C++ folks, I have trouble to open files whose path contains non-ascii characters with std::ifstream. For instance let's say i just have a file which has Japanese characters either in the...
5
by: waqasahmed996 | last post by:
hi to all i have a php file within i redirect a page. but when i include this file in another directory then i also have to change path of redirect file. like this ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.