Load attachments via VBA (1 Viewer)

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
When I stated that you should leave both references, I was referring to the DAO reference and the Access Database Engine reference. 15 should have Recordset2.

Did you Debug > Compile?

If i leave the DAO i cant add the 14.0 Access database, i can only use the existing 15.0
 

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
That other problem got solved mate. Thanks but now when the file dialog pop opens and you chose the files i got error in this line, i tryed add the me.prefix but didnt solve.
"Set rsAttach = .Fields("Me.Anexo412").Value"
The mensage is item not found in collection
Maybe i have to say what is the form of this field?
 
Last edited:

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
It clearly states...
I put "Set rsAttach = .Fields("Anexo412").Value" but same mensage error. Cant find item in collection.
I guesse i change it as you said. Youre the man. Im putting preview foto name and not the collumn on the table. Now is uploading right.
Im gonna test the multi upload now to see if is doing right
 

vbaInet

AWF VIP
Local time
Today, 18:27
Joined
Jan 22, 2010
Messages
26,374
Anexo412 is not the name of the field, it is the name of the attachment.

What you want is the name of the attachment field in the table. Have a look in the table and use that name there.
 

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
Well now is uploading right the way i wanted but i have 8 attachment fields that can be populated with photos. Do you have an ideia how to upload the max of 8 photos at once?
I need it to be that way to make after another button for download all populated photo fields at once
 

vbaInet

AWF VIP
Local time
Today, 18:27
Joined
Jan 22, 2010
Messages
26,374
I don't understand. Why do you have 8 attachment fields? One attachment field can hold multiple attachments.
 

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
I don't understand. Why do you have 8 attachment fields? One attachment field can hold multiple attachments.
Because i tough that it was the right way to do it.
I need to see the 8 previews at same time. Im putting a print screen to see what i have. I think that you will have an idea what im saying.
If you teach me how to put one box showing all of 8 photos can be a simple solution
 

Attachments

  • 4.jpg
    4.jpg
    89.7 KB · Views: 79
Last edited:

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
Just for saying to you that im daoing this database for my family bussiness so we are happy to when i finish this project make you a donation. You deserve it
 

vbaInet

AWF VIP
Local time
Today, 18:27
Joined
Jan 22, 2010
Messages
26,374
To be honest, my suggestion of saving the path alone would have been a much better solution.

I'll investigate how you can extract the 8 images and display them in the attachment controls, and I'll let you know much later. I think you can use just one attachment field and display the images in the 8 unbound attachment controls.
 

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
To be honest, my suggestion of saving the path alone would have been a much better solution.

I'll investigate how you can extract the 8 images and display them in the attachment controls, and I'll let you know much later. I think you can use just one attachment field and display the images in the 8 unbound attachment controls.

I only need to be able to see the 8 photos in the form, i can use your solution.
I tried to change the view property to see more photos but i cant find the solution. I'm not kidding about the donation. We help who help us.
 

vbaInet

AWF VIP
Local time
Today, 18:27
Joined
Jan 22, 2010
Messages
26,374
I missed your other post #30. We do what we can to help :) I hope your business is doing well!

Ok, I can get the images to display from top to bottom (i.e. vertically - see attached), but if you want the images to be laid out horizontally it can be done but the form would need to be in Single Form view. What's the default view of the form at the moment?

You could use an OLE Object data type and create 8 of these but this is a waste of space and it isn't as compressed as the attachment field.

The much better solution I was talking about was the one I mentioned here:
However, have you considered saving the path to the file instead of attaching it to the db? That's a much better practice.
Have you given this some thought? You would only need to put the images in a specific folder.
 

Attachments

  • MultipleAttachmentView.accdb
    688 KB · Views: 89

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
I missed your other post #30. We do what we can to help :) I hope your business is doing well!

Ok, I can get the images to display from top to bottom (i.e. vertically - see attached), but if you want the images to be laid out horizontally it can be done but the form would need to be in Single Form view. What's the default view of the form at the moment?

You could use an OLE Object data type and create 8 of these but this is a waste of space and it isn't as compressed as the attachment field.

The much better solution I was talking about was the one I mentioned here:
Have you given this some thought? You would only need to put the images in a specific folder.

It could be a solution.
I think its a single form. But I don't know how to use the OLE Object Data type to create a view horizontal. Right now the code is copying the photo or the path? I agree with your idea, but can i program it to save the path but copy the files from the Photo machine SD Card to the pre determined folder and then save the path?

I put my project in this URL http://www.4shared.com/file/80pXUwuwce/SOCAR_TERA_30_06_12_00.html
If you don't understand what is written ask me because its all in Portuguese.
 
Last edited:

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
I can make a video show you and explaining what i need to do and why.
I need that after the form shows all photos to when i double click the photo to maximize it for viewing.
Just need to use the command maximize?
My father and i talked about the possibility that we can make a few donations and you become like a database advicer, and help me programming at distance.
I dont know if you have time for that. That could be an litle more money on your accont, we are happy to help you because i think that if we booth get down to program the database it could be finished in a few weeks.
You talked about the OLE and attach it withing the database whats the better for a big database? Im expecting have 80.000 auto parts with a normal attachemnts of 5 per item.
 

vbaInet

AWF VIP
Local time
Today, 18:27
Joined
Jan 22, 2010
Messages
26,374
The better option is to put the images in a specific folder, save the path to the image in a Text field and then use 8 Image controls to display the images.

I wasn't able to download your db, I think the site is down at the moment. Upload it on here by clicking the "Go Advanced" button below and you will then see where to attach the files.

Can you confirm that the form is a Single Form? Have a look at the Default View property in the form's property sheet.
 

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
The better option is to put the images in a specific folder, save the path to the image in a Text field and then use 8 Image controls to display the images.

I wasn't able to download your db, I think the site is down at the moment. Upload it on here by clicking the "Go Advanced" button below and you will then see where to attach the files.

Can you confirm that the form is a Single Form? Have a look at the Default View property in the form's property sheet.

I cant upload as you said. The form is defined as Dynaset.
Im uploading to another source and send you the link.
Link to database: http://www.megafileupload.com/hl9J/SOCAR_TERÇA_30_06_12_00.accdb
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 18:27
Joined
Jan 22, 2010
Messages
26,374
What problems did you encounter when you tried to upload?
It's the Default View property you should be looking at.
 

freddykat

Registered User.
Local time
Today, 18:27
Joined
Jul 4, 2015
Messages
33
What problems did you encounter when you tried to upload?
It's the Default View property you should be looking at.
Is set to Continuous form:D What's the difference between single and continuous form?
I didn't find the advanced to upload the project
 

Users who are viewing this thread

Top Bottom