P
Prado01
Guest
G'day all,
I am very new to VBA programming have have basically been teaching myself as I go.
I have created a function that will import text files automatically on the opening of the DB. One of the files that is import automatically is only created once a month but the DB is open atleast once a week. I have tried to create an error handler that will show a msgbox when this file "Audit.txt" can not be found but continues on to the next Docmd in the function. Has anyone got any examples of how I can do this.
I have attached the code for the function to import the text files in.
Cheers
Prado01
DoCmd.TransferText acImportDelim, "AuditImportSpecification", "Nursing Audit", "M:\audit.txt", True
DoCmd.TransferText acImportDelim, "ClinicalindicatorsImportSpecification", "Clinicalindicators", "M:\clinicalindicators.txt", True
DoCmd.TransferText acImportDelim, "ProceduresImportSpecification", "Procedures", "M:\procedures.txt", True
DoCmd.TransferText acImportDelim, "VentdataImportSpecification", "Ventdata", "M:\ventdata.txt", True
DoCmd.TransferText acImportDelim, "OsmoFloImportSpecification", "Osmoflo", "M:\OsmoFlo.txt", True
I am very new to VBA programming have have basically been teaching myself as I go.
I have created a function that will import text files automatically on the opening of the DB. One of the files that is import automatically is only created once a month but the DB is open atleast once a week. I have tried to create an error handler that will show a msgbox when this file "Audit.txt" can not be found but continues on to the next Docmd in the function. Has anyone got any examples of how I can do this.
I have attached the code for the function to import the text files in.
Cheers
Prado01
DoCmd.TransferText acImportDelim, "AuditImportSpecification", "Nursing Audit", "M:\audit.txt", True
DoCmd.TransferText acImportDelim, "ClinicalindicatorsImportSpecification", "Clinicalindicators", "M:\clinicalindicators.txt", True
DoCmd.TransferText acImportDelim, "ProceduresImportSpecification", "Procedures", "M:\procedures.txt", True
DoCmd.TransferText acImportDelim, "VentdataImportSpecification", "Ventdata", "M:\ventdata.txt", True
DoCmd.TransferText acImportDelim, "OsmoFloImportSpecification", "Osmoflo", "M:\OsmoFlo.txt", True