Hi all
I need to write and read data to txt file . i have a 8 textbox as array index . i could write data in file but i can load data to textbox array so that each data show in own textbox. for example :afte loading data txt(0).text=txt0.all data loads in txt(0) but i want to load each data as separate textbox.
code for wite :
code for read :Code:Dim sFileText As String Dim iFileNo As Integer Dim iCount As Integer Dim sFileTextt As String Dim iFileNoo As Integer Dim iCountt As Integer Private Sub Command1_Click() iFileNo = FreeFile 'open the file for reading Open App.Path & "\Roster1.txt" For Output As #iFileNo 'read the file until we reach the end Do While Not iCount = 4 '30 sFileText = Txt(iCount) Write #iFileNo, sFileText iCount = iCount + 1 Loop Do While Not iCountt = 4 '30 sFileTextt = Tx(iCountt) Write #iFileNo, sFileTextt iCountt = iCountt + 1 Loop Close #iFileNo MsgBox "Written data to file." End Sub
I also attached source projectCode:Private Sub Command3_Click() Dim dText As String, dNextLine As String, lLineCount As Long lLineCount = 1 Open App.Path & "\Roster1.txt" For Input As #1 Do While Not EOF(1) Line Input #1, dNextLine dNextLine = Replace(dNextLine, Chr$(34), "") dText = dText & dNextLine '& vbCrLf Loop Txt(i).Text = dText End Sub
Sorry for my poor english
Please solve my problem
thanks all




Reply With Quote
