The problem is that the Input statement does not allow any extra work to be done in its procedure, this includes reading a property of a control. Do the following to amend your problem:
Code:
Dim sData As String
Dim iFileNum As Integer
iFileNum = FreeFile
Open App.Path & "\Notepad.txt" For Input Access Read Shared As #iFileNum
Input #iFileNum, sData
Close #iFileNum
Text1.Text = sData
It will work that way now, however, use the following for a better and more efficient results:
Code:
Dim iFileNum As Integer
iFileNum = FreeFile
Open App.Path & "\Notepad.txt" For Input Access Read Shared As #iFileNum
Text1.Text = Input(LOF(iFileNum), #iFileNum)
Close #iFileNum
Later.