
07-14-2003, 12:38 AM
|
 |
Google Hound
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,386
|
|
So, you need to Open the textfile for Input, and loop through reading a line of text, checking the status, if the status read matches the entered status Update the Textboxes & exit the loop.
Code:
Dim strLine as String, strData() as String
Open "test.txt" For Input As #1
Do While Not EOF (#1) And strStatus <> txtStatus.Text
Line Input #1, strLine ' Read the entire line into the string
strData = Split(strLine," ") ' Split the data into component fields
If strData(2) = me.txtStatus.Text then
me.txtRequest.Text = strData(0)
me.txtName.Text = strData(1)
End If
Loop
I hope the name doesn't include a space, else the split won't be able to differentiate between a space used as a field delimitor and one used to separate first & last names. IF you use a comma to separate the fields, you could read the data directly into variables using the input command
Code:
Line Input #1, strRequest, strName, strStatus
|
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
|