Thanks for your reply. I did find these commands after searching the internet most of the day yesterday.
I was using lower case letters in the Send Keys command. The command worked fine until we switched to a faster computer. I'm not sure how your comment about not using the OLE field would apply to my application. The main purpose for including the picture in the database is so I can have it print on a Crystal Report from our ERP system. We have criteria for releasing jobs from our system, at which time we print a Job Traveler that includes a digital picture of the part. I have set up a process to automatically populate the database with the pictures for the parts that are due to be released that day. I think I need to have the pic in the database field to be able to use it in the Crystal report, but regardless, bloat is not an issue, because the list of part #'s and corresponding pictures is deleted and repopuluated daily. Thanks again for your help. Brian Stenglein --- In AccessDevelopers@yahoogroups.com, "A.D.Tejpal" <[EMAIL PROTECTED]> wrote: > Brian, > > With Pic as the name of bound OLE control on the form and Path as the name of control holding full path of image file, the following set of statements in form's code module should suffice. > > Pic.SourceDoc = Path > Pic.Action = acOLECreateEmbed > > Note - If linked image is desired, use acOLECreateLink instead of acOLECreateEmbed > > As the path for image file is already available with you, the preferred alternative would be to eliminate the OLE field from your table altogether, in order to prevent unnecessary bloating of your db. > > Instead, you can place an image control in report's detail section and assign the file path to its picture property via print event (of detail section). DO NOT USE THE FORMAT EVENT FOR THIS PURPOSE. > > Best wishes, > A.D.Tejpal > > ps: Just for academic interest, your existing SendKeys commands should work successfully, if lower-case key names are used (e.g. f, e, v instead of F, E, V). But you should no longer be needing any of this. > > ----- Original Message ----- > From: Brian Stenglein > To: AccessDevelopers@yahoogroups.com > Sent: Monday, October 03, 2005 18:48 > Subject: [AccessDevelopers] Insert Object from file with code. > > > Second request for help. Does anyone know some code to insert an object from a file? I have the path I want to insert in the same record. > > > I have an application that goes through a list of Part #'s and inserts the Digital Picture into a table for each part for printing. > > I know its not best practices so don't yell at me for doing it, but I > did the best I could at the time. I had been using a macro with the following; > > GotoControl -> Path > RunCommand -> Copy > GotoControl ->Pic > Runcommand -> Insert Object > SendKeys -> %F%E^V{Enter} > GoToRecord->Next > > This macro was being called by a function in a module that was looping through once for each part. > > It had worked well until recently, we had a problem with the PC that was running the process each night and rebuilt it with a newer one. > Now it hangs at the Send Keys command after the Insert Object Dialog is opened. > > My goal is to do the equivalent of; > Insert Object > Create from File > Paste the file name from the clipboard or use the file name contained in the field "Path" for the current record. > > Can somebody help me with the proper code to do this? > > Thanks, > > Brian Stenglein ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/