andymartin3186
Member
- Local time
- Today, 06:42
- Joined
- Dec 10, 2024
- Messages
- 77
Hi,
When a new record is created, my form uses the after insert event to create a folder with the customer name, and inside this the job number
Folder structure is M:\Job Photos\CustomerName\M12345\
Inside this folder I have the facility to select 4 photos and use these on the form using their filename to display the images (not an attachment)
I have a function as below:
When I click browse on each photo on the form it calls the below:
Is there a way I can set the file dialog to open at the customer name\ job number of the current open form? The path would look something like the below.
"M:\Job Photos\" & CustomerID.Column(1) & "\" & JobNumberFormatted & "\"
When a new record is created, my form uses the after insert event to create a folder with the customer name, and inside this the job number
Folder structure is M:\Job Photos\CustomerName\M12345\
Inside this folder I have the facility to select 4 photos and use these on the form using their filename to display the images (not an attachment)
I have a function as below:
Code:
Public Function PickFile() As String
Dim FO As Object
Set FO = Application.FileDialog(3)
FO.Show
PickFile = FO.SelectedItems(1)
End Function
When I click browse on each photo on the form it calls the below:
Code:
Private Sub Photo1_Click()
On Error GoTo errhandle
Photo1 = PickFile()
exitErr:
Exit Sub
errhandle:
If Err.Number = 5 Then
MsgBox "File Upload Cancelled", vbCritical, "File Upload"
Else
MsgBox "Error (" & Err.Number & ") - " & Err.Description & " Occurred."
End If
Resume exitErr
End Sub
Is there a way I can set the file dialog to open at the customer name\ job number of the current open form? The path would look something like the below.
"M:\Job Photos\" & CustomerID.Column(1) & "\" & JobNumberFormatted & "\"