Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file naming question 1

Status
Not open for further replies.

JustineB

Programmer
Mar 30, 2001
165
0
0
GB
I have to create some files (exported from MSaccess tables). The files are creating and exporting just as I like, except for one thing.
I need to add a '.' (dot) into the file name. I realise that this is really bad naming practice, but this is how the files need to be named in order for some other software to find them. an example of a name would be 27.09pri_front.txt.

When I try and add the dot, the files are still created, but the dot has been substitued by a hash (#).

Am I trying to do the impossible? If so, please can someone let me know? If not, any advice would be very grateful.

Here is the part of the code that creates the output file. I am using MSAccess 2002.

Many thanks!

Code:
'Here the original filename is set eg: 29.09
Orig_file = Forms![Switchboard]![Original]

'Does reworkfolder exist?

folderpath = reworkfolder

If fso.FolderExists(folderpath) Then
    'MsgBox "folder Exists"
    
    Else
    MkDir reworkfolder
End If

DoCmd.TransferText acExportDelim, "Rework_Back Export Specification", "rework_back", reworkfolder & "\" & Orig_file & "back_REM.txt", True
DoCmd.TransferText acExportDelim, "Rework_Front Export Specification", "rework_front", reworkfolder & "\" & Orig_file & "front_REM.txt", True
 
You may try this after the TransferText call:
If Orig_file Like "*.*" Then
Name reworkfolder & "\" & Replace(Orig_file, ".", "#") & "back_REM.txt" AS reworkfolder & "\" & Orig_file & "back_REM.txt"
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You are truly awesome! Whatever you are being paid is not enough - I wish I could give you more than one star!

Thanks you so much PH!

Justine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top