Public Sub GetScores()
'-- Import all of the student scores to the tblScores table.
Dim OurFolder As String
Dim OurFile As String
'-- First have the user select the folder
OurFolder = BrowseFolder1("Select the folder that contains the scores.")
'-- Dir returns a ZLS ("") when no more files match the criteria
OurFile = Dir(OurFolder & "\*.txt")
Do While OurFile <> ""
'-- I created and saved the ScoreImportSpecs earlier.
'-- I also created the tblScores table with the following
'-- four text fields:
'-- FirstName, LastName, ClassCode, Score
DoCmd.TransferText acImportDelim, "ICES", "Table1", OurFile
CurrentDb.Execute "UPDATE table1 SET TYPE='" & Left(OurFile, 1) & "', LISTING='" & Mid(OurFile, 3, 6) & "', FILEDATE=#" & DateSerial(Mid(OurFile, 14, 4), Mid(OurFile, 12, 2), Mid(OurFile, 10, 2)) & "# WHERE LISTING Is Null"
'-- Get the next *.txt filename
OurFile = Dir
Loop
End Sub