T
Tammy
This is really just a VBA question, I guess. I am trying
to use the 'filecopy' or 'name' statement so that when
the user clicks on a button on the form he/she moves the
file from a 'drafts' folder to a 'saved' folder. I keep
getting error messages that the file or path is not
found. However, there was a search done both by me and
prviously in the program (filesearch) which confirms the
file exists. Apparently there is a problem copying the
file to the new folder?! The folder does exist, but the
file will normally (not always) be a new file.
Here is the current code: (I have used the 'kill'
command with the 'filecopy' as I actually want the file
moved and to not exist anymore in the 'drafts' folder!
They are commented out as I was testing the 'name'
statement!)
THANKS!
'move file from "drafts" to "SavedSOPs": uses
filecopy to copy the file & then 'kill'
'statement to delete the draft file
strSPath = "C:\Documents and Settings\Owner\My
Documents\SOPs\drafts\"
strDPath = "C:\Documents and Settings\Owner\My
Documents\SOPs\SavedSOPs\"
strFile = Me![txtSOP] & ".doc"
strSFile = strSPath & strFile
strDFile = strDPath & strFile
Name strSFile As strDFile
'FileCopy strSPath, strDPath
'Kill strSPath
to use the 'filecopy' or 'name' statement so that when
the user clicks on a button on the form he/she moves the
file from a 'drafts' folder to a 'saved' folder. I keep
getting error messages that the file or path is not
found. However, there was a search done both by me and
prviously in the program (filesearch) which confirms the
file exists. Apparently there is a problem copying the
file to the new folder?! The folder does exist, but the
file will normally (not always) be a new file.
Here is the current code: (I have used the 'kill'
command with the 'filecopy' as I actually want the file
moved and to not exist anymore in the 'drafts' folder!
They are commented out as I was testing the 'name'
statement!)
THANKS!
'move file from "drafts" to "SavedSOPs": uses
filecopy to copy the file & then 'kill'
'statement to delete the draft file
strSPath = "C:\Documents and Settings\Owner\My
Documents\SOPs\drafts\"
strDPath = "C:\Documents and Settings\Owner\My
Documents\SOPs\SavedSOPs\"
strFile = Me![txtSOP] & ".doc"
strSFile = strSPath & strFile
strDFile = strDPath & strFile
Name strSFile As strDFile
'FileCopy strSPath, strDPath
'Kill strSPath