G
Guest
Hi All,
I have a popup form that allows a user to go through the file dialog browse
window, or whatever you call it, to locate a file for import. The path and
filename are stored as one long string in a listbox.
How do I retrieve this value to use in a Transfertext command? I am trying
to use the listbox value as a string in my transfertext command so that any
file in any directory can be used. Of course, I'm not sure exactly how to do
this either.
My listbox is called Filelist.
Here is my Transfertext command:
DoCmd.TransferText acImportFixed, "DMAImportDataImportSpecification",
"DMAImportData", "L:\STW\DAImportData.Txt"
I would like to pull that value from the Listbox , and put in a variable
called File_Location_Name so it can be used as part of the Transfertext
command where I now have the "L:\STW\DAImportData.txt".
How do I declare File_Location_Name is it an object or string? I assumed
string.
I thought I could pull out the FileList value like this, but it doesn't
appear to work:
File_Location_Name = Forms!File_Prompt_Form!FileList(0)
I want to use the value from the listbox in my Transfertext command where
the "L:\STW\DAImportData.Txt" is being used since the directory path and
filename will vary.
Any help you can give will greatly be appreciated!
Thanks
I have a popup form that allows a user to go through the file dialog browse
window, or whatever you call it, to locate a file for import. The path and
filename are stored as one long string in a listbox.
How do I retrieve this value to use in a Transfertext command? I am trying
to use the listbox value as a string in my transfertext command so that any
file in any directory can be used. Of course, I'm not sure exactly how to do
this either.
My listbox is called Filelist.
Here is my Transfertext command:
DoCmd.TransferText acImportFixed, "DMAImportDataImportSpecification",
"DMAImportData", "L:\STW\DAImportData.Txt"
I would like to pull that value from the Listbox , and put in a variable
called File_Location_Name so it can be used as part of the Transfertext
command where I now have the "L:\STW\DAImportData.txt".
How do I declare File_Location_Name is it an object or string? I assumed
string.
I thought I could pull out the FileList value like this, but it doesn't
appear to work:
File_Location_Name = Forms!File_Prompt_Form!FileList(0)
I want to use the value from the listbox in my Transfertext command where
the "L:\STW\DAImportData.Txt" is being used since the directory path and
filename will vary.
Any help you can give will greatly be appreciated!
Thanks