Hi..I have a file which looks like this
txtBox1|4
txtBox2|7
txtBox3|5

I'd like to read in the file and have the values be read into the Texboxes....

so txtBox1.text has 4

I have the following code....but I need some help as it doesn't work that good...

VB Code:
  1. Public Sub OpenBestand()
  2.    
  3.     On Error GoTo ErrHandle
  4.   Dim elements() As String
  5.  
  6.     frmInput.BestandVenster.DialogTitle = "Open file..."
  7.     frmInput.BestandVenster.Filter = "TXT File(*.txt)|*.txt|All Files(*.*)|*.*"
  8.     frmInput.BestandVenster.FilterIndex = 1
  9.     frmInput.BestandVenster.ShowOpen
  10.        
  11.     fnum = FreeFile
  12.     FileName = frmInput.BestandVenster.FileName
  13.     Open FileName For Input As #fnum
  14.    
  15.  
  16.     Do Until EOF(1)
  17.     Line Input #fnum, data
  18.        
  19.         elements = Split(data, "|")
  20.         "frmInput." &  elements(UBound(elements) - 1) & ".value" = elements(UBound(elements))
  21.         MsgBox EOF(1)
  22.     Loop
  23.  
  24. Close #fnum
  25.      
  26. Exit Sub