Dear all,
At the moment I am working on a program/tool where people can add a comment supported by a picture. The comment is stored in a table and the picture should be stored in a predefined location.
After selecting an image (browse button, which I already have), the selected image should be stored in an fixed location (eg. my documents/pictures). On the form a preview should be shown from the picture.
The name/location of the image should be saved in the table and the preview should appear after the file have been browsed.
The fields used on the form are:
Browse button - Command67
picture field - OLEBound63
textbox - Text70 : displays selected file location image
Code behind browse button:
I hope somebody is able to help me!! Somehow I do not understand
the functionality with pictures in Access.
Thank you in advance
Wouter
At the moment I am working on a program/tool where people can add a comment supported by a picture. The comment is stored in a table and the picture should be stored in a predefined location.
After selecting an image (browse button, which I already have), the selected image should be stored in an fixed location (eg. my documents/pictures). On the form a preview should be shown from the picture.
The name/location of the image should be saved in the table and the preview should appear after the file have been browsed.
The fields used on the form are:
Browse button - Command67
picture field - OLEBound63
textbox - Text70 : displays selected file location image
Code behind browse button:
Code:
Private Sub Command67_Click()
Dim cmdlgOpenFile As New clsCommonDialog
Dim FileName As String 'full file name
Const clngFilterIndexAll = 5
cmdlgOpenFile.Filter = "picture Files (*.Jpeg)|*.jpg|All Files (*.*)|*.*"
cmdlgOpenFile.FilterIndex = clngFilterIndexAll
'this is where the dialog opens
cmdlgOpenFile.ShowOpen
'returns your full file name.
FileName = cmdlgOpenFile.FileName
Me.Text70 = FileName
Me.OLEBound63 = cmdlgOpenFile
'hence no len, no name...
If Len(FileName) = 0 Then Exit Sub
End Sub
Thank you in advance
Wouter