Still not sure what you are trying to achieve...
Do you mean you want to save the file in the directory?
This function would return the fullfilepath accounting for a file existing there already... The alternate would be to delete the existing file and save the new one.
function GetAvailableFilePath (byref Path as string, byref filename as String) As String
dim FullFileName as string
dim indx as integer = 1
dim Extn as integer = instrRev(filename, ".")
'ensure ends with \
if Right(Path,1) <> "\" then
Path = Path &"\"
FullFileName = Path & filename
if Dir(FullFileName) <> "" Then
'file Exists - assuming you wish to not overwrite:
While Dir(FullFileName) <> ""
'Keep incresing indx and adding to file name until we have no match
FullFileName = Path & left(filename, extn-1) &"(" &indx &")" & mid(filename, extn)
indx = indx+1
Not to save the file have I already done automatic.
As what I will is that when the user press button ( Getbackup)
the file list box should just point to
app.path\backup or go to app.path\backup\backup
and there select the file they will use.
Nothing else should bee visible Just this 2 directories