I have several forms in my database which show results in unbound textbox.What I want is to save these results in a text file.With my code a text file is generated but the problem is how to show the results?
This statement shows result in the unbound textbox
This statement shows result in the unbound textbox
Code:
me.txt1= me.txt1 & vbnewline & "Showing " & counter & " " & zahl1 & " in the text file."
Code:
Private Sub Command12_Click()
Dim iFileNumber As Integer
Dim sFilename As String
Dim sDirectory As String
Dim sYourString As String
Dim sYourString2 As String
Dim hello As String
sDirectory = "C:\" & hello
sYourString = "CaseNo: "
sYourString2 = "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
sFilename = Trim(Str(Year(Now()))) & "_" & Trim(Str(Year(Now()))) & "_" & Trim(Str(Month(Now()))) & "_" & Trim(Str(Day(Now()))) & ".txt"
iFileNumber = FreeFile
If Dir(sDirectory, vbDirectory) = "" Then MkDir (sDirectory)
Open sDirectory & sFilename & ".txt" For Append As iFileNumber
Print #iFileNumber, sYourString
Print #iFileNumber, sYourString2
Close #iFileNumber
End Sub