to import a whole bunch of files using wildcards, the best method I have found is to create a folder 'done' within the folder that they are stored, then use a bit of code like this:
Dim Filename as String
While Dir("C:\Mydir\*.*") <> ""
filename = Dir("C:\Mydir\*.*")
DoCmd.TransferText acImportFixed, "MySpecificationName", "MyDestinationTable", "C:\mydir\" & filename
'NB the above might be TransferSpreadsheet or TransferDatabase in your case
DoEvents
Name "c:\mydir\" & filename As "C:\Mydir\done\" & filename
DoEvents
Wend
This way, files are moved into the 'Done' subfolder after importing and you don't have to worry about the possibility of importing the same file twice, or missing one.
to export files with sequential filenames, I use a table called 'System' - in this table, I set up an autonumber field called 'Instance' and other fields such as 'NextFileNumber' (enter that number 10001 here - you'll see why later), you can use a table like this to save various system defaults such as default file search paths, system name etc, but anyway, I then use code like this to ensure that the file exported has an unique name each time:
DoCmd.TransferDatabase acExport, "dBase III", "C:\MyOutDir\", acTable, "MyTable", "FILE" & Right(Str(DLookup("[fgn]", "[system]", "[instance] = 1")), 4)
DoCmd.RunSQL "UPDATE system SET system.NextFileNumber = [NextFileNumber]+1 WHERE (((system.Instance)=1));"
This exports a file called FILE0001.dbf (it uses the last 4 digits of the NextFileNumber value in the system table, then it updates the number so that the next time it is run, the file name will be FILE0002.dbf and so on...
(the reason for the autonumber in the system table is that, if somebody fiddles and adds a row, the DLookup will always look at the values in row 1)
Hope this helps
Mike
[This message has been edited by Mike Gurman (edited 01-30-2001).]