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

Full PathName capture on Table

Status
Not open for further replies.

JLeo

Technical User
Feb 10, 2003
44
US
Hi,

Been pondering over this for the last few days to no avail.

I have a drive with 3 general level of folders {Phase#},{Location},{category} in which files are stored in. All folder names and contents are different but placed under the same organisation structure.

eg:"C:\Phase2\North\Complaints\complaints.doc" or
"C:\Phase3\East\Commendations\Commendations.doc"

How can i capture the full path name of the files in a table "tblSiteDoc" record with the corresponding fields of [Phase#],[Location],[category], [Filename].

Would like to seek some advice on how to proceed. Thanks.


 
Hi

Do not know how much VBA you know, so not sure how much explanation you need, but my start point would be to iterate through the folders using the DIR() function to extract file names and paths and save them into the table Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
If you are viewing your information from a form, you can add the following to the On Click event of a command button

Me.NameofFieldtoUpdate = "C:\" & me.[Phase#] & "\" & me.Location & "\" & me.category & "\" & me.filename & ".doc"

HTH
 
Hi KenReay and jfgambit,

Thank you for your reply.

I am not viewing the info from a form but wanna use a form with those 3 catagories to open the doc for info.

Regarding my knoleadge in VB, i am a relative newbie and generally need a little help here and there to proceed. I did try using the Dir() function before i posted this but i found it diffcult to get it to work iteratively.

eg:
{Phase#} level has around 4 folders which each contains
{location} has another 4 folders which each contains another
{category} has another 7 folders
----> 112 possible iterative paths of which each contains a few *.doc

Also this figures are dynamic as folders would be either created or deleted.

With the Dir(), i was able to get the 1st level of folders but am stuck going to the 2nd onwards. Is there a command that specifies a complete path of a certain type of file *.doc in a directory. Perhaps with this pointer i am able to proceed. Or should i use 3 sub loops to do this?

Thanks.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top