Insert a Picture

V

Vinnie

Hi....

I have developed a Form were a user can enter data, I want to include a
field were the user can click in it and insert a picture from a given
folder, but not too sure how to program such filed.

Please help

Regards
 
A

Arvin Meyer [MVP]

It would be more advantageous to use an image control on the form and save
the file and path to the table, then use the form's Current event to display
the image. To do that, use the control's picture property:

Sub Form_Current()
Me.ImageCtlName.Picture = Me.txtPath & Me.txtFileName
End Sub

An example of this for both form and report, as well as code to grab all the
images in a folder/subfolder is at:

http://www.datastrat.com/Download/Picture2K.zip
 
V

Vinnie

Thanks for your reply Arvin

I understand what you mean, but I want the user to be able to navigate
through his/her hard drive and select a picture...For example:

The end user is collecting coins, he enters the related information and
wants to select a coin image from his/her drive and insert it on the
database, I don't want to store hunderds of pictures on the data base, just
the ones the user may need..

Not too sure if I explain myself clearly (Sorry for my english)

I can email and example of what I need...

Regards

Vince
 
A

Arvin Meyer [MVP]

Yes, I understand, and the code to navigate is within:
http://www.datastrat.com/Download/Picture2K.zip

a similar, but more specific example for a single image can be adapted from:

http://www.mvps.org/access/api/api0001.htm

You will need to apply a filter for just image files, which is part of what
I did in my sample.

And you don't need to store hundreds of images. If you put only the images
that the users needs in a single folder, you can use my code to navigate to
that folder and grab them all.

Now add a field to the table to link your data and the picture data, and
have the user fill in that field with the ID from the main record, now use a
query to join the 2 tables and you can display the records with little extra
work.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top