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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paiste file into access table vba 1

Status
Not open for further replies.

hermanlaksko

Programmer
Aug 26, 2001
940
DK
I want to "import" a file such as a doc, xls or pdf file info a field (OLE) in a table.

I can open a pathfinder and select the file but I only get, at best, the filepath.
However when paisting in i.e. a mail I see the file selected via pathfinder.

Has anyone the solution to this problem - Thanks in advance.


Herman
Say no to macros
 
Hi

if i have understood your question correctly, this is how i did it, but can not say i am an expert..just it worked for me.

' I chkd for if the field is null first, if it was empty (null) then i passed it the string location of the file via 'sourcedoc

Hope this helps.
David

If IsNull(Me.Image.Value) Then
FileStr = "M:\Data\My Pictures\" & Me.OrigLoc.Value & Me.OrigFile.Value
'update the picture file
Me.Image.SetFocus
Me.Image.OLETypeAllowed = acOLEEmbedded
Me.Image.SourceDoc = FileStr
Me.Image.Action = acOLECreateEmbed
DoCmd.Save

End If
 
Hi Ginger

Yes you understood me exactly correct and your solution worked here too :)

Thx a mill

Herman
Say no to macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top