Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Object - Attaching to a record 1

Status
Not open for further replies.

Cort

MIS
Apr 16, 2002
154
US
Any help would be greatly appreciated:

Access 97.

I have a table with the fields photo 1, 2, 3, 4, 5. Their object types are OLE objects.

I have inspectors going to homes and taking photos. As it is now on their form they have to click to attach, select file type then selct the location of the file to attach each photo.

What I would like to do is to have a commmand button above each Photo "slot" that would automate the task and get the inspector to the "select file location" part of the insert object.

Thank you again for any assistance.
 
For each command button:

First set focus to the image control field, then do the insert object runcommand:

Me!Photo1.SetFocus
DoCmd.RunCommand acCmdInsertObject

Good luck! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Thanks for the help:

Me!Photo1.SetFocus
DoCmd.RunCommand acCmdInsertObject

didn't work got a Run Time Error 438, Object doesn't support this property or method.

Photo1.SetFocus
DoCmd.RunCommand acCmdInsertObject

does allow the photo to be inserted hovever, once I insert 1 photo when I go to insert photo #2 I get "access denied" to the directory the photos are in. If I exit access and restart I can then insert Photo 2 but that is impractical.

Have any clue as to how to make Access release control of the folder so additional photos can be entered?

Thank You again for your help.
 
Bump it up for a little love.

Any ideas?
 
I set up a table to test this out, with a form with 3 photo ole fields. I can both link and insert without any issues.

Is the directory on a server, or are the photos local? Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Local, on my C: drive. Hmm, I'l continue to work on it here thanks.
 
OK, I fixed it. Just me being an idiot.

When the insert window would pop up again I would just hit Open and have to press browse first to select a file. I was trying to inset a folder into the record not a file :)

Works great. Thanks
 
I am trying to do somewhat the same thing.
I have a db used as an IT helpdesk task organizer, i want to let the people who want something done be able to "attach" files to the helpdesk record.

I've tried to create a table with 3 OLE object fields, and linked the first field to a control field on a form, but..

I Have 2 problems.

1: If i close the form, and reopen it, there is no data in the field or table, although it was there when i clicked the command button.

2. I get a 2046 error.

I'm not to familiar with OLE-object in ACCESS, which is probably why this is not working.


Could someone pls help?

Christoffer Systemconsultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top