I'm trying to use Random Access File to save records.
My problem is that the next records is saved in the same line, but i need save the record line by line.
This if what i try but don't work:


Sub Grabar()
mascaraquita


elsize = FileLen(App.Path + "\DatosEmpleados.txt")
TotalDeRecords = elsize / 150 'this make a new record

posicion = TotalDeRecords + 1


empleado.SeguroSocial = Me.txtSeguroSocial.Text
filler1 = Space(1)
empleado.Transaccion = Me.txtTransaccion.Text
empleado.LlaveGenerica = Me.txtLlaveGenerica.Text
empleado.Operador = Me.txtOperador.Text
empleado.Terminal = Me.txtTerminal.Text
empleado.FechadeEntrada = txtFechadeEntrada.Text
empleado.HoradeEntrada = Me.txtHoradeEntrada.Text
empleado.numerodetrimestre = Me.cmbanotrimestral.Text
empleado.Codigo = Me.txtCodigo.Text
empleado.SalariodeEmpleado = Me.txtSalariodeEmpleado.Text
empleado.NumerodeCuenta = Me.txtNumerodeCuenta.Text
filler2 = Space(4)
empleado.CodigoDot = Me.txtCodigoDot.Text
filler3 = Space(2)
empleado.Indicador = Me.txtIndicador.Text
empleado.NumerodeBatch = Me.txtNumerodeBatch.Text
empleado.FechadeEfectividad = Me.txtFechadeEfectividad.Text
empleado.CodigodeBatch = Me.txtCodigodeBatch.Text
empleado.CodigodePagina = Me.txtCodigodePagina.Text
empleado.CodigodeOriginacion = Me.cmbCodigodeOriginacion.Text
empleado.NombredelEmpleado = Me.txtNombredelEmpleado.Text
empleado.InicialdelEmpleado = Me.txtInicialdelEmpleado.Text
empleado.ApellidoPaterno = Me.txtApellidoPaterno.Text
empleado.ApellidoMaterno = Me.txtApelidoMaterno.Text
filler4 = Space(4)
filler5 = vbCrLf ' filler5 As String * 2
Open App.Path + "\DatosEmpleados.txt" For Random As #2 Len = Len(empleado)
Put #2, posicion, empleado
Close #2

End Sub

How to save in the Text File this line by line?