Dear All,
Thanks for a great forum!
I have a challenging problem...
I have a form with a subform, the subform is used for images.
The image is linked and uses the PropertyName-Number field as the image name, the path is predefined.
I have the following code in the subform PropertyPicturesSubform
What I want to do is enable to user to choose the image they want, with a browse for image button.
So when clicked the button code opens a find file dialog box and the user then chooses the file and then the code takes the name of the file and inserts it into the PicureName-Number field.
And then links it as it does above.
Any help would be greatly appreciated.
Thanks
Thank you,
Kind regards
Triacona
Thanks for a great forum!
I have a challenging problem...
I have a form with a subform, the subform is used for images.
The image is linked and uses the PropertyName-Number field as the image name, the path is predefined.
I have the following code in the subform PropertyPicturesSubform
Code:
Private Sub Form_Current()
Dim path As String
FileExists
End Sub
Sub FileExists()
Dim fso
Dim path As String
path = "\\wbc-fp-1\users\etienne\data\My Pictures\Houses\" & [PicureName-Number] & ".jpg" ' change to match the file w/Path
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(path) Then
[green]' MsgBox path & " was not located.", vbInformation, "File Not Found"[/green]
Me.PropIm.Picture = "\\wbc-fp-1\users\etienne\data\My Pictures\Houses\BLANK.jpg"
Else
Me.PropIm.Picture = path ' MsgBox path & " has been located.", vbInformation, "File Found"
PicturePath = path
End If
End Sub
So when clicked the button code opens a find file dialog box and the user then chooses the file and then the code takes the name of the file and inserts it into the PicureName-Number field.
And then links it as it does above.
Any help would be greatly appreciated.
Thanks
Thank you,
Kind regards
Triacona