Hi All![]()
I have something like this
Unfortunatelly, now I want to save into txt file my data that are in a 5 textboxes. How I should to do it? How to save and how I should to back read into this 5 textboxes. Someone know?Code:Private Sub cmdSave_Click() Dim strBuffer As String Dim intDemoFileNbr As Integer Dim strFileToSave As String On Error GoTo cmdSave_Click_Exit With dlgDemo .CancelError = True .InitDir = mstrLastDir .Flags = cdlOFNOverwritePrompt + cdlOFNPathMustExist .FileName = "" .Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*" .ShowSave strFileToSave = .FileName End With On Error GoTo cmdSave_Click_Error intDemoFileNbr = FreeFile Open strFileToSave For Binary Access Write As #intDemoFileNbr strBuffer = txtTestFile.Text Put #intDemoFileNbr, , strBuffer Close #intDemoFileNbr mstrLastDir = Left$(strFileToSave, InStrRev(strFileToSave, "\") - 1) Exit Sub cmdSave_Click_Error: MsgBox "The following error has occurred:" & vbNewLine _ & "Err # " & Err.Number & " - " & Err.Description, _ vbCritical, _ "Save Error" cmdSave_Click_Exit: End Sub
Thanks in advance![]()
Tamgovb




Reply With Quote