Jason: I'll certainly look over your vb code in detail later! Love analyzing vb code.
For my situation, there will always be only ONE file out there for each part, never multiple files with different revision numbers (client finally got back to me with that info). And the part number can be both numbers and letters, so there will be multiple R's in the filename (such as: "HammerR3.doc").... For now, a simple while loop incrementing a number from 1 to 30 did the trick. He said that revisions have never historically gone over 10, so we did 30 just to be safe. Karen > I may have another solution. I wrote a VBScript file that will get a > list of all the files for a given part number, find the revision number, > write > a CSV file with all the matching file names and revisions, loads the file > into a temp table and then selects the max revision. This way, you don't > have to worry about maximum revisions. If your customer suddenly decides to > start revisions at 1000, you won't be stuck because you were counting > backwards from 30. Also, this gives you all revisions in a table so you can > offer to show older revisions (depending on how much you like your customer, > of course) > > This solution depends on the file names always being <partnum>R< > revisionnum>.ext. If the file name has more than one R, you will get very > odd > results. > > Please let me know if you want a sample DB.

