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!

Import File Path

Status
Not open for further replies.

razchip

Technical User
Feb 2, 2001
133
US
Does anyone have a suggestion on how to import the file path and file name into a table. I have a large nubmer of files to either key or import, the table field is "text" and I would like to import the follwoing:

\\Page\Data\Pallets\01006.jpg



Thanks for the help.
Greg
 
The path should always be the same in this case, it's just the file name that would be different each time.

Thanks for the help.
Greg
 
Ok then...
how do know which file name belongs to which record?
 
What I'm trying to import is the the record. I have a large database of jpeg files, I need to put them in a table where I use an Access form to pull in the selected jpegs for viewing.

Thanks for the help.
Greg
 
You need a table already built to accept the values. In the following code I have used a table called jpgtable with a field called myfilepath, defined as text, 255.

Sub addlist()

Dim str
str = Dir("g:\jpgfiles\*.jpg") ' change this to your path
Do While str <> ""

CurrentDb.Execute "Insert into jpgtable (myfilepath)values('g:\jpgfiles\" & str & "')", dbFailOnError

str = Dir
Loop
msgbox "Done"

End Sub
 
Just put it together and it worked fine, thanks for the help.

Thanks for the help.
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top