Results 1 to 2 of 2
Thread: Accessing a Query (Access 97)
2001-08-13, 13:31 #1annie0219Guest
Accessing a Query (Access 97)
I am writing code to run pull out information that i need from various files. Somewhere with in this code, I need to figure out a way to run a query that I have set up. Does anyone know how to access or run a query with in code? Please Help!!!!
- The following is the code I am already using, basically, it pulls information from a file and updates a table, then when I am done with the info in the table, it clears the table. In between filling the table and clearing the table is when I need to access or run the query- Thanks in advance
Dim f As String
f = Dir("C:WinntProfilesacarrierDesktopTesting Database*" & "*_trk.csv")
Do While f <> ""
DoCmd.TransferText acImportDelim, "00000001 Link Specification", "Target_Information", "C:WinntprofilesacarrierDesktopTesting Database" & f
Dim db As Database
On Error Resume Next
Set db = CurrentDb
db.Execute "DELETE * FROM Target_Information;"
f = Dir
2001-08-13, 13:40 #2
- Join Date
- Dec 2000
- Burwash, East Sussex, United Kingdom
- Thanked 198 Times in 184 Posts
Re: Accessing a Query (Access 97)
DoCmd.OpenQuery should do what you need. You can check out the syntax required for your particular needs in the help files.
Hope that helps.Regards,
Microsoft MVP - Excel