Control to browse for an Image File (1 Viewer)

Was the question/problem easy to understand?

  • Yes

    Votes: 3 75.0%
  • No

    Votes: 1 25.0%

  • Total voters
    4
  • Poll closed .

MSAccessUser

Registered User.
Local time
Today, 14:07
Joined
Aug 17, 2005
Messages
21
Hi,

I'm trying to add a control to my form that I don't know how to do.


On my form, I want the user to be able to click a button which will open up the standard file open dialog box. The user then will be able to browse through the appropriate directory and select an image file which will be saved on that specific record.

Attached is a strip down database as an example.

How can I do this? Any help would be greatly appreciated - I'm trying to do this for my work.
 

Attachments

  • db3.zip
    13.4 KB · Views: 124

MSAccessUser

Registered User.
Local time
Today, 14:07
Joined
Aug 17, 2005
Messages
21
That was a good example - especially the fFindOpenImportFile form. Ok, so now that I can browse to an Image file - how can I save the Image as an embedded object as a record in the database.

I know it is frowned upon to save images as embedded objects but I would like to do this at a small scale.

Please assist.
 

MSAccessUser

Registered User.
Local time
Today, 14:07
Joined
Aug 17, 2005
Messages
21
Still Need Help!! Hopefully it's not too tough of a question...!!

I hope I didn't ask too tough of a question... I haven't seen any responses/comments to this over the last few days and I really need to finish this last piece for my deadline.

"On my form, I want the user to be able to click a button which will open up the standard file open dialog box. The user then will be able to browse through the appropriate directory and select an image file which will be saved on that specific record."


Any help on this would be greatly appreciated!!
 

mixup

Registered User.
Local time
Today, 17:07
Joined
Jul 29, 2005
Messages
34

MSAccessUser

Registered User.
Local time
Today, 14:07
Joined
Aug 17, 2005
Messages
21
That's very helpful - One last thing to make it perfect...

Those were great links! Thanks for your reply!


There is only one problem. I created forms and reports to display the images and it works fine for the records that actually contain images.

However, for the records that do not contain any images there is a problem. The form and report show the images from the previous record for these non-image records. I would like the form and report to display nothing or blank images for these records.


How can this be corrected?
 

ghudson

Registered User.
Local time
Today, 17:07
Joined
Jun 8, 2002
Messages
6,194
Test the existance of the image file in the forms OnCurrent event. Display the image if it exists, hide the control if an image file does not exist for the current record. Use the Dir() function to test if an image file exist. Search around for examples if you do not know how to use the Dir() function.
 

Users who are viewing this thread

Top Bottom