M
Mike
I have the following code which is using the copy and kill command to
move files from one folder to another. It worked pretty good for
private use, but now I need it in the office and I would need to
prompt the user in case the file already exists.
My code so far:
Private Sub Command9_Click()
Dim strNewName As String
Dim strOldName As String
Dim strtargetfilepath As String
'defines where to look for the target filepath'
strtargetfilepath = DLookup("[Draft to Active]", "filepath")
'takes the name and path of the file of a continuous form'
strOldName = Me.Filename
'adds the old file name to the target filepath'
strNewName = strtargetfilepath & "\" & Me.Name1
FileCopy strOldName, strNewName
Kill strOldName
End Sub
I need something that checks if the new filename (target filepath +
Name1) is already there.
Can anyone help me?
move files from one folder to another. It worked pretty good for
private use, but now I need it in the office and I would need to
prompt the user in case the file already exists.
My code so far:
Private Sub Command9_Click()
Dim strNewName As String
Dim strOldName As String
Dim strtargetfilepath As String
'defines where to look for the target filepath'
strtargetfilepath = DLookup("[Draft to Active]", "filepath")
'takes the name and path of the file of a continuous form'
strOldName = Me.Filename
'adds the old file name to the target filepath'
strNewName = strtargetfilepath & "\" & Me.Name1
FileCopy strOldName, strNewName
Kill strOldName
End Sub
I need something that checks if the new filename (target filepath +
Name1) is already there.
Can anyone help me?