Function UneDosFicheros(FicherO1 As String, FicherO2 As String) On Error GoTo Err_CmdInicia_Click Dim CanalLibre1, CanalLibre2, LaLinea As String Dim ArchivoDestino As String, ArchivoTemporal As String ArchivoDestino = CurrentProject.Path & "\ArchivoJunto.txt" If Dir(ArchivoDestino) <> "" Then If vbYes = MsgBox("ya existe el archivo de rejunte, eliminar?", vbYesNo + vbExclamation) Then Kill ArchivoDestino End If ArchivoTemporal = CurrentProject.Path + "\~Myrejunte.TMP" If Dir(ArchivoTemporal) <> "" Then Kill ArchivoTemporal ' si hay temporal, le borro CanalLibre1 = FreeFile Open ArchivoTemporal For Output As #CanalLibre1 DoEvents CanalLibre2 = FreeFile Open FicherO1 For Input As #CanalLibre2 Do While Not EOF(CanalLibre2) DoEvents Line Input #CanalLibre2, LaLinea Print #CanalLibre1, LaLinea Loop Close #CanalLibre2 Open FicherO2 For Input As #CanalLibre2 Do While Not EOF(CanalLibre2) DoEvents Line Input #CanalLibre2, LaLinea Print #CanalLibre1, LaLinea Loop Close #CanalLibre2 Close #CanalLibre1 FileCopy ArchivoTemporal, ArchivoDestino Kill ArchivoTemporal MsgBox "Tamaño del archivo unido: " + Format(FileLen(ArchivoDestino) / 1024, "##0.00 Kb") Exit_CmdInicia_Click: Exit Function Err_CmdInicia_Click: MsgBox Err.Description Resume Exit_CmdInicia_Click End Function OTRO METODO 'RUTINA PARA UNIR 2 FICHEROS 'MODIFICALA PARA TUS ARCHIVOS O MEJORALA PARA 'QUE FUNCIONE CON TEXTBOXS ;) ' 'PASO # 0, DEFINIR VARIABLES 'DEBES TENER UNA REFERENCIA AL "Microsoft Scripting Runtime" Dim FSO As New FileSystemObject Dim Archivo As File Dim Buffer As TextStream Dim Contenido As String 'OK, PASO # 1, ABRIR EL PRIMER FICHERO Y EXTRAER CONTENIDO Set Archivo = FSO.GetFile(App.Path & "\ARCHIVO1.TXT") Set Buffer = Archivo.OpenAsTextStream(ForReading) Contenido = Buffer.ReadAll 'PASO # 2, ABRIR EL SEGUNDO FICHERO Y EXTRAER CONTENIDO Set Archivo = FSO.GetFile(App.Path & "\ARCHIVO2.TXT") Set Buffer = Archivo.OpenAsTextStream(ForReading) Contenido = Contenido & Buffer.ReadAll 'ojo con esta linea 'Como ya supondrás, puedes repetir el proceso cuanto lo necesites. 'PASO # 4, GRABAR EL ARCHIVO FINAL Open App.Path & "\ARCHIVOFINAL.TXT" For Output As 1 Print #1, Contenido Close 1 MsgBox "FIN DE LA UNION DE ARCHIVOS" Ojo, que en VBA de Access no existe la App Si deseas probarla, substituye App.Path por CurrentProject.Path