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

Know of, But not how : Record Sets..........

Status
Not open for further replies.

DerickD

IS-IT--Management
Sep 19, 2002
93
LU
Hi All,

I've posted this in a couple of the forums as I do now know which people have the best knowledge of what I want to create....

I think (95%) that I need to use a record set for my problem, but if there is a 'better' way of doing this then I would like know.

I have a table that contains ProjectName and ProjectPath.

E.g.

Project Sales has path C:\Work\Projects\MoreMoney\SalesProject Refusal has path C:\Work\Projects\LessMoney\Refusal



I have created a Form that contains a drop down box that conatins all the ProjectNames and a Button that says "Import All Files from Project Directory" I know how to import all the files from one directory using the code (not complete..) ...............

Code:
myFiles = Dir(myPath & "/*.*")
Do While myFiles = ""
DoCmd.TransferText acImportDelim, myImportSpec, "Temp Import", myFiles

' ** Some appending and sorting going on here **

Loop

MsgBox ("Done!!")
End Sub
[\Code]

............. But I do not know how to get the Path Name into the code, so (PathName Where ProjectCombo = ProjectName) = myPath

How oh How do you get that.. ?!! ??? help
[img]http://www.predigt.net/Predigten/Help_small.JPG[/img]
 
Hi,

Think you need DLookup....

MyPath = DLookup("[MyTable]", "ProjectPath")

Where 'MyTable' is the name of the table containing the path record and 'ProjectPath' is the name of the field contaiing the path.

If you've got seperate records holding different paths then you would provide criteria to select the correct record...

MyPath = DLookup("[MyTable]", "PathField", "[PathID] = 1")

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top