473,395 Members | 1,454 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.

User defined drive location for docmd.TransferText

Hi there, can anyone tell me how to allow the user to enter in a path on there harddrive for a transfertext item? It works just fine if I set it programmatically, but I really need them to do this, because the location may change.
This is in Access 2000, btw.

Thanks, proteusgak
May 17 '07 #1
3 3298
ADezii
8,834 Expert 8TB
Hi there, can anyone tell me how to allow the user to enter in a path on there harddrive for a transfertext item? It works just fine if I set it programmatically, but I really need them to do this, because the location may change.
This is in Access 2000, btw.

Thanks, proteusgak
Expand|Select|Wrap|Line Numbers
  1. 'First, you must set a Reference to the Microsoft Office XX.X Object Library
  2. Dim varItem As Variant, strSelectedFile As String
  3.  
  4. With Application.FileDialog(msoFileDialogFilePicker)
  5.    With .Filters    'only 1 Filter needed
  6.      .Clear
  7.      .Add "Text Files", "*.txt"
  8.    End With
  9.        'The Show Method returns True if 1 or more files are selected
  10.        .AllowMultiSelect = False
  11.        .ButtonName = "Find Text File"
  12.        .InitialFileName = vbNullString
  13.        .InitialView = msoFileDialogViewDetails
  14.        .Title = "Select Ttext File to Transfer"
  15.               If .Show Then
  16.                    For Each varItem In .SelectedItems
  17.                      strSelectedFile = varItem     'will only be 1
  18.                    Next varItem
  19.               End If
  20. End With
  21.  
  22. 'Sample example
  23. DoCmd.TransferText acImportDelim, , "<Table Name>", strSelectedFile, "<True or False>"
May 17 '07 #2
First, Thank you!

For those that might look at this thread, my intent was to "export" a file that the user could manipulate in a bound table field. Thanks to aDezii
the following simple code was gleened.
Expand|Select|Wrap|Line Numbers
  1. Dim varItem As Variant, strSelectedFile As String
  2.         strSelectedFile = BillingDriveLocation 'bound table field allowing for user to input variable drive locations
  3.     DoCmd.TransferText acExportFixed, "As400MLV618", "as400", strSelectedFile
It works great!

Again, thank you.
ProteusGak
May 17 '07 #3
ADezii
8,834 Expert 8TB
First, Thank you!

For those that might look at this thread, my intent was to "export" a file that the user could manipulate in a bound table field. Thanks to aDezii
the following simple code was gleened.
Expand|Select|Wrap|Line Numbers
  1. Dim varItem As Variant, strSelectedFile As String
  2.         strSelectedFile = BillingDriveLocation 'bound table field allowing for user to input variable drive locations
  3.     DoCmd.TransferText acExportFixed, "As400MLV618", "as400", strSelectedFile
It works great!

Again, thank you.
ProteusGak
Sorry for the mix-up.
May 17 '07 #4

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

Similar topics

4
by: Teresa | last post by:
I'm trying to import a tab delimited text file. The text file does not have column heading. I can give it column heading if needed. How do I change the defult comma delimited to tab? If I...
1
by: Patrik | last post by:
I have two problems with the following access/vba line : DoCmd.RunSQL ("EXECUTE master..xp_cmdShell 'bcp SEEPE.dbo.##Tbl_Temp_Stats out D:\Stats.txt -c -t'") First this command only works...
3
by: holdemfoldem | last post by:
Hi. I'm new to this board and have a few questions about using the method referred to in the topic of this message. I have manually transferred over 1/2 million records from a text file into my...
0
by: Chris | last post by:
Hi, I am using the command below for exporting data to text file. One of the query columns has SINGLE number type with decimal ponts as auto. DoCmd.TransferText acExportDelim,...
14
PEB
by: PEB | last post by:
Hi all, Yesterday i've tried this command: DoCmd.TransferText acExportDelim, "Comma_SEP", "myquery", "D:\Temp\Temp.txt" And it gave me an Error that can't find "D:\Temp\Temp.txt" This...
3
by: victoria.rego | last post by:
Hi there, My application is generating a "The OpenForm action was cancelled" error and I can't seem to figure out why. The best part about it is that it's only one user in the entire building -...
4
by: jessek | last post by:
I’m trying to use DoCmd.TransferText, (I use it successfully with a .txt export every day) to export a table into a CSV file. Right now every time I try – it says: Run-time error 3011 The MS...
0
by: Cuaracao | last post by:
This is my code: Code1: 'DoCmd.OpenTable "tblImport" 'DoCmd.TransferDatabase acExport, "dBASE IV", strOutputDir,acTable,"sel_TblImport", strDbfName & ".dbf", False ' DoCmd.Close acTable,...
20
by: =?Utf-8?B?QnJpYW4gTmljaG9sc29u?= | last post by:
Hello, I'm trying to create an admin page that can run miscellaneous scripts for our IT department. Currently, I'm trying to create a script that can map a network drive for a user (e.g. a form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.