Here is the original code
Function import_idcard_and_coupon_file(
Dim ImpSpecID As Strin
Dim ImpTblID As Strin
Dim ImpFileID As Strin
Dim ImpSpecCoup As Strin
Dim ImpTblCoup As Strin
Dim ImpFileCoup As Strin
ImpSpecID = "Import ID Card Data
ImpTblID = "ID Card Data
ImpSpecCoup = "Import Coupon Book Data
ImpTblCoup = "Coupon Book Data
DoCmd.RunSQL "Delete * from [ID Card Data]
DoCmd.RunSQL "Delete * from [Coupon Book Data]
filnameID = Dir("\\david\c\documents and settings\dave\desktop\ahp_idcards*.txt"
Do Until filnameID = "
DoCmd.TransferText acImportDelim, ImpSpecID, ImpTblID, filnameID, Tru
filnameID = Dir(
Loo
filnameCoup = Dir("\\david\c\documents and settings\dave\desktop\ahp_coupon*.txt"
Do Until filnameCoup = "
DoCmd.TransferText acImportDelim, ImpSpecCoup, ImpTblCoup, filnameCoup, Tru
filnameCoup = Dir(
Loo
DoCmd.OpenQuery "Coupon Book Query
DoCmd.RunMacro "Update_TMG_COUPON_File
DoCmd.OpenReport "ID Cards (8-up)", acViewPreview, "", "", acNorma
DoCmd.OpenReport "Coupon Book", acViewPreview, "", "", acNorma
DoCmd.OpenQuery "Count ID Cards", acViewNormal, acEdi
DoCmd.OpenQuery "Count Coupon Books", acViewNormal, acEdi
DoCmd.OpenQuery "ID Card Data Archive Qry", acViewNormal, acEdi
DoCmd.OpenReport "Coupon Book Archive Qry", acViewNormal, "", "", acWindowNorma
DoCmd.OpenReport "Count of Return Envelopes", acViewPreview, "", "", acNorma
End Functio