In short, after creating a new record, I have a process in which the user can add attachments to that record (the attachments are saved in the server and not the database as object).
I would like to insert a process right before the upload that will rename the file selected and use the number of the record as new name without changing the file extension.
Example: If I perform the upload from Record # 123 then if I select file from: Drive:\whatever\whatever\t
Then, before the upload the file name will be changed to: Drive:\whatever\whatever\1
As in this example, everything stays the same except for the file name which has changed from test to 123
strInputFilePath = ahtCommonFileOpenSave( _
DialogTitle:="Please select an input file...", _
strFilename = Dir(strInputFilePath)
---the file re-name process need to be here---
strNewFilePath = "\\hmcapp1\Data\WQDBASES\wqd\Attach\" & Me.Site
Me.txtWhatFile = strNewFilePath
If FileExists("\\hmcapp1\Data\WQDBASES\wqd\Attach\" & Me.Site & "\" & strFilename) Then
If MsgBox(strFilename & " already exists." & vbCrLf & _
"Would you like to replace it?", vbYesNo + vbQuestion, "Attention!") = vbYes Then