Adding photos to DB from the form

red_101au

New member
Local time
Today, 13:40
Joined
Oct 18, 2012
Messages
9
:banghead:
Hi,
I am a teacher in China and I have created a DB to store my students records, eg: Student Number, English Name, Chinese Name, Birthdate, Class Number, Age, and exam scores, I also have a photo frame to display the students photo.
In the data sheet I have an ole object field where I add the photos, the thing is it means I need to manually add this to the data sheet, whereas I can add all the other details directly from the form "Add New Record" and also search, delete or edit all from the form.
I have searched and searched but I cannot find any info that acurately explains how I may add the photos to the data sheet from within the form where I have placed a button "Add Photo". I assume I need to create a macro and assign it to the button (on click) then this would need to open a search file location box where I can find the photo and select it to be added to the file.
The point is I wish to be able to do all the adding, deleting and editing from within the form and not have to enter into the data sheet at all.
By the way.... I am using Office 2010
any assistance would be greatly appreciated
thanks in advance
 
As I recall you can display an attachment as a picture.
Might that not be a simpler way of achieving the goal?
 
Thanks Anakardian,
That may be another alternative, but I doubt it would give the same results.
 
I would be surprised that a Datasheet would display an image whilst a Continuous Form will, that is, Access 2007+.

I you think about if the Image is called by the Student Number you can referentially identify the Image without storing the Image. This was necessary because to Access 2007 images were stored as bitmaps. In Access 2007, at least, images were stored in their native formats.

Simon
 
Hi Simon_MT,
you are right with earlier versions the images needed to be stored as bitmap, and as a matter of fact I do have them still stored as bmp. this is not a problem, and they are stored in another folder called pics.... they do show up in the database form when run as a program no problem. the problem is that i need to add the photos in the data sheet view to the add ole object field of each students details.
I am able to add, delete, and edit all the details from the form when using it as an app.... all except adding photos. It is the code to make it possible to add photos within the form app that I need.... I am starting to think this is impossible with Access. I have tried creating macros and command lines to direct the app to open a search file box so I can locate the picture, add it and save it to the student file. And failing miserably :(
 
ok I have had a small breakthrough on this .... I have managed to get the form to display the CommonFileOpenSave box where I can select the folder where the photos are and can select the photo, however it does not add the file to the Insert Object field on the database table. Maybe I am going about this wrong .... all I need I think is to set the code to open the Insert Object window of the table.... any help on this also appreciated..... I will keep you informed
 
Last edited:
:D
Hi again...
ok, decided to totally change my approach and went back to the oldie but trusted way of doing things. Decided to get rid of the "Ole Object Field" alltogether and just revert back to the file path to the photos. I have a dedicated folder for the photos on D: and a browse folders box that is set by default to go to that folder when I click "Add Photo Button" where I can select the image and automatically store the path in the data sheet table, and everything is working perfectly.
Thanks to all for your suggestions and assistance
 

Users who are viewing this thread

Back
Top Bottom