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

Creating a default folder

Status
Not open for further replies.

CMPaccess

Technical User
Dec 18, 2003
52
AU
What I'm trying to do is retreive a specific entry from a table to help create a default path.

i.e I have a table with all my drawing data in. This includes a path to the drawings.

I want to be able to extract that path data into my code in order to help create a new folder below it.

Something like this

Private Sub Command141_Click()
Dim ExpPath As String
Dim ExstPath As String
Dim exApp As Object
Set exApp = CreateObject("Excel.Application")
ExstPath = "GETDATAFROMTABLESOMEHOW"
MkDir ExstPath & "\Excel_Lists"
ExpPath = ExstPath & "\Excel_Lists"
DoCmd.OutputTo acQuery, "ExcelQuery", "MicrosoftExcel(*.xls)", ExpPath & "DrawingList.xls", True, ""
exApp.Workbooks.Open ExpPath & "DrawingList.xls"
End Sub

Is this possible ??

thanks
 
when you say get path from table, do you mean:

1) get the path of the database that contains the table?
2) the path of a filename stored in a table?

for 1, you can just use the [YourObject].Path property

for 2, just extract the path from the filename by using something like:
Left("filename", InStrRev("filename", "/"))


--------------------
Procrastinate Now!
 
what I was trying to say was :-

I have a table called Drawings. This has a field called path.

I want to be able to extract say the path data for the first entry in the table. Not all entries just one.

Does that make sense.

thks
 
Something like this ?
ExstPath = DLookUp("path", "Drawings")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PH, I will try that and let you know.

Cheers
 
PH,

Works a treat. Your a start

Thanks alot.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top