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

File name as field

Status
Not open for further replies.

mtdew

Technical User
Dec 9, 2007
77
US
I need to have several table linked together and know the source of the data. Is there a way to have one of the fields contain the file name from which some of the data is pulled?
 



Sure. Tables can contain almost any kind of data. But why put that value on every row in the table?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi Mtdew,

Sounds like you have a similar request to my recent post titled "How do I create variables for linked data?".

While I do not yet have my solution for my recent post, perhaps you might benefit from the following: I currently use an Excel macro to pull the file name and file location from a specific cell, within a specific worksheet. The code looks like this:

=======================================================
lcFolder = Sheets("Admin").Range("B8").Value
lcFileNameDataGL = Sheets("Admin").Range("B9").Value

ChDir lcFolder
Workbooks.Open Filename:= _
lcFolder & "\" & lcFileNameDataGL
=======================================================

assume "B8" (above) contains the value of "C:\users\public\documents"
assume "B9" (above) contains the value of "test.xls"
Then do whatever you need to do using the data stored in the file called "C:\users\public\documents\test.xls".

Hope this helps.

Dave
 
IMHO, It's not even clear what application is involved. A reference to fields could infer Word or Access. Excel, on the other hand, doesn't have anything called fields.

Cheers
Paul Edstein
[MS MVP - Word]
 
Good point Paul ... and my apologies MtDew ... I neglected to ask what application you need assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top