R
rfburn
I am trying to build an interface for users to browse to a photo file, select
the file and save it to a drectory folder. I don't want them to overwrite
existing filenames, so I have been attempting to automate the process wherein
Access VBA renames the file before saving it to the destination folder. I
have been working on it for two days, and still can't get it to work. Here
is a code snippet which shows the value inserted into a table as well as the
filename being saved to the folder:
FileCopy strFiles, strIMGPath & Dir(strFiles)
DoCmd.SetWarnings False
vPositionID = Nz(DMax("PositionID", "tblProduit_Photo", "[RefID]=" &
Forms!frm_Site_Info!ID)) + 1
DoCmd.RunSQL "INSERT INTO tblProduit_Photo ( File, RefID, PositionID )
SELECT '" & strFiles & "' AS Files, " & Forms!frm_Site_Info!ID & " AS Cpt, "
& vPositionID & " AS vPos;"
DoCmd.SetWarnings True
the file and save it to a drectory folder. I don't want them to overwrite
existing filenames, so I have been attempting to automate the process wherein
Access VBA renames the file before saving it to the destination folder. I
have been working on it for two days, and still can't get it to work. Here
is a code snippet which shows the value inserted into a table as well as the
filename being saved to the folder:
FileCopy strFiles, strIMGPath & Dir(strFiles)
DoCmd.SetWarnings False
vPositionID = Nz(DMax("PositionID", "tblProduit_Photo", "[RefID]=" &
Forms!frm_Site_Info!ID)) + 1
DoCmd.RunSQL "INSERT INTO tblProduit_Photo ( File, RefID, PositionID )
SELECT '" & strFiles & "' AS Files, " & Forms!frm_Site_Info!ID & " AS Cpt, "
& vPositionID & " AS vPos;"
DoCmd.SetWarnings True