Chosing a picture and showing a preview of it on a from

wdenboer

Registered User.
Local time
Today, 19:47
Joined
Feb 4, 2009
Messages
14
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:

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
I hope somebody is able to help me!! Somehow I do not understand :confused: the functionality with pictures in Access.

Thank you in advance

Wouter :)
 

Users who are viewing this thread

Back
Top Bottom