Help with an image/attachment & button

kellbehell

New member
Local time
Today, 11:52
Joined
Apr 3, 2018
Messages
7
Hi, I am building a database for a church for their small groups and leaders. I have tables for leaders and groups but the problem that I am having is with a form. I have a for to add a new leader, and a second form to add a photo to an existing leader. For the addphoto form, I have a combo box of the leaders names and an image to add their headshot. Now, I want the image to be blank when I open the form and I want to save the attachment once its been added to that persons record depending on who I select on the combo box.. I want the button to save the update picture to the record and close the form.

I have the macro to close the form but when I try to save the photo, it makes a new record with no other data, no matter what name I select in the combo box.

Please help!! I do know the basics of Access but I am in no way an expert (obviously) lol thanks for the help!
 
Last edited:
What is the code for your save button?
Are you saving a path to the image or are you saving the image inside your database?

In most cases saving the path to the image works far better than trying to save the image itself.
 
I was planning of saving the image in the database since the photos will be coming from a few different places from different people through out our network..

And honestly, I used the wizard for the Save button.. I figured I'd try that to begin with bc coding is not my strong suit but I will have to do more research/googling to get the right code. I do know enough to manipulate coding to what my form titles are and whatnot but it takes me a while to get to actual code to do what I want it.. hence why i tried the button wizard first!
 
I was planning of saving the image in the database since the photos will be coming from a few different places from different people through out our network..
Personally, I would recommend keeping the images in a central file location rather than saving them inside your database. This allows your database to concentrate on saving data rather than doing the job of a file server. More important, it allows you to easily change out images or edit images without having to export from your database first then re-import.

And honestly, I used the wizard for the Save button.. I figured I'd try that to begin with bc coding is not my strong suit but I will have to do more research/googling to get the right code. I do know enough to manipulate coding to what my form titles are and whatnot but it takes me a while to get to actual code to do what I want it.. hence why i tried the button wizard first!
Are you trying to update more than one table at the same time with your form? From the description, you are updating a table for "Images" after you've done... something... to import the image but you may not have the tables related. Can you give an overview of what table/tables are being used and their fields?
 
Last edited:
No, its just the one table... Okay, so in my Leaders table, I have a field for an attachment named leaderphoto. I have a form called addnewphoto. I have a combo box that shows the names of the existing names of leaders. When I select one, I want to be able to attach the photo and save the photo to the record then the form to close when I click the saverecord button.

Did I explain that correctly? :(
 
Have you made sure that the record for the "leader" you are trying to attache a picture to is loaded?
 
If your form is bound, you can put a field on the form that shows something relevant, such as your "Leader"'s name or address. Also double check how you are loading the proper record after you use the combo box to see if you have any errors.

If you are NOT doing anything to load the leader then that would answer why you keep adding new records.
 
The Northwind Employee Details form allows just that function?
 
take a look a the sample. right click on the attachment to add/edit/delete (manage attachment).
 

Attachments

Thank you! That works!! I appreciate it!

And yes, I just looked at the Northwind details... Thanks for the help also!
 

Users who are viewing this thread

Back
Top Bottom