-
I am looking after a new application written with VBA for access which has these lines in it.
gen declarations
Private Const IMASPRODUCTIONASCIIFILE As String = "ImasProd.dat"
Private Const FTPDIR As String = "c:\ftp60\"
sub to write to file
Open FTPDIR & IMASPRODUCTIONASCIIFILE For Output As #1
the open line is where it bombs out. The ftp60 dir is there on the PC but the dir does not contain the ImasProd.dat file prior to the running of the program. I thought that the prog would automatically create the file if it does not exist already. Is this not the case ?
Any comments or help would be great.
Many thanx
locutus
-
?
Works for me - sure you are not using #1 anywhere else?
Strange one,
Paul.
-
You might try assigning a variable name to the keyword FreeFile, e.g.
intModelFile = FreeFile
Open strModel For Output As #intModelFile
Do stuff here.......
Close #intModelFile
FreeFile automatically finds the next available file for input, output, append, etc. Be sure that you close the file when you're through with it.
-
thanks , prob solved
cheers guys problem solved , much appreciated