Recordset that displays files that meet criteria

  • Thread starter Thread starter Gray S via AccessMonster.com
  • Start date Start date
G

Gray S via AccessMonster.com

I've been searching around the forums today and even turned to Access Help
trying to figure this one out. I don't want to waste the weekend searching,
so I figured I'd make a post and hope someone knows how to accomplish what
I'm trying to do...anyways, here it goes:

I'm trying to make a recordset or query that displays external files that
meet a criteria...such as a query that displays all test*.txt files in a
certain directory. Eventually I want to base a form on this recordset
allowing the user to click on a file to open it...I know how to do that, it's
just creating the recordset that is tough to figure out.

If anyone could assist me with this, I'd greatly appreciate it!
 
I reviewed your link, but how can I capture file names as records? What I'm
trying to do, is search for a file name based on a certain form's record id
number. So if I'm in a record using a form, and the record id number is 99999,
I would like to create a recordset that searchs a certain directory, finding
files that begin with 99999....such as 99999*.txt. For each file that matches
that criteria, a record is created, on the fly.

I've played around with the Dir() function, but it returns all files names as
one record...sort of like concatenate.



Allen said:
Using ADO, you can create a recordset on the fly (i.e. the values are not
stored in a table).

Details and examples:
http://www.papwalker.com/ref101/adors.html
I've been searching around the forums today and even turned to Access Help
trying to figure this one out. I don't want to waste the weekend
[quoted text clipped - 10 lines]
If anyone could assist me with this, I'd greatly appreciate it!
 
Dir returns the *first* filename matching your argument.

Subsequent calls to Dir (with no argument) returns the remaining calls until
the length of string is zero.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Gray S via AccessMonster.com said:
I reviewed your link, but how can I capture file names as records? What I'm
trying to do, is search for a file name based on a certain form's record
id
number. So if I'm in a record using a form, and the record id number is
99999,
I would like to create a recordset that searchs a certain directory,
finding
files that begin with 99999....such as 99999*.txt. For each file that
matches
that criteria, a record is created, on the fly.

I've played around with the Dir() function, but it returns all files names
as
one record...sort of like concatenate.
Allen said:
Using ADO, you can create a recordset on the fly (i.e. the values are not
stored in a table).

Details and examples:
http://www.papwalker.com/ref101/adors.html
I've been searching around the forums today and even turned to Access
Help
trying to figure this one out. I don't want to waste the weekend
[quoted text clipped - 10 lines]
If anyone could assist me with this, I'd greatly appreciate it!
 
Back
Top