1 Replies - 1204 Views - Last Post: 01 June 2009 - 04:09 AM Rate Topic: -----

#1 ray_ray  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-June 09

is it possible to read of a text file to get data to put into a form?

Post icon  Posted 01 June 2009 - 12:06 AM

is it possible to read of a text file to get data to put into a form?
Is This A Good Question/Topic? 0
  • +

Replies To: is it possible to read of a text file to get data to put into a form?

#2 rganesan84  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 28-May 09

Re: is it possible to read of a text file to get data to put into a form?

Posted 01 June 2009 - 04:09 AM

View Postray_ray, on 31 May, 2009 - 11:06 PM, said:

is it possible to read of a text file to get data to put into a form?



Hi,

Public Sub DisplayLastLogInformation()
Const LogFileName As String = "C:\temp\test.txt"
Dim FileNum As Integer, tLine As String

FileNum = FreeFile ' next file number
Open LogFileName For Input Access Read Shared As #FileNum ' open the file for reading
Do While Not EOF(FileNum)
Line Input #FileNum, tLine ' read a line from the text file
Loop ' until the last line is read
'Close #FileNum ' close the file
MsgBox tLine, vbInformation, "Last log information:"
End Sub

try the above code to read & retrieve data and store into the variable "line" and put the variable into your userform...

thanks..

Ganesan Rajaiyan
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1