If I understand you correctly, you want to have a sequential file... that file will have a path in it, to a picture file, that you will load, is this correct?
dim seqfile as string
dim tmpvar as string
open seqfile for input as #1
line input #1, tmpvar
close #1
picture1.picture = tmpvar
Similarly, If You want to have 1 sequential file, with multiple paths (to different pictures), then you could read that into a collection as such:
dim xPaths as new collection
dim seqfile as string
dim tmpvar as string
seqfile = "c:\somefile.dat"
open seqfile for input as #1
do until eof(1)
line input #1, tmpvar
xPaths.Add tmpvar
loop
close #1
If I'm way out in left field, then please elaborate your question, and I'll be happy to assist you in any further help that you need.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
The INPUT has to be within the loop, in order to loop through the entire file. Also, if you have records AFTER the record that is actually found, that are not containing the part number in strProdNo, Then lblDscrpt and lblCo get set to Not found and nothing. So, Pretend that you have a file with:
not what you want
not what you want
what you want
not what you want
Then The Captions Get Reset on the last line of the file, because it's not what you are looking for. You need to do 1 of two things here.... the best way is to beak out of the loop, before it finishes reading the file. So, Your code would look a little something like this:
Private Sub cmdGetInfo_Click()
strProdNo = txtProdNo.Text
Do While Not EOF(1)
Input #1, co, part, dscr, ul
If strProdNo = part Then
lblDscrpt.Caption = dscr
lblCo.Caption = co
If ul = "UL1" Then
imgUL.Visible = True
exit do
Else
If ul = "UL2" Then
imgUL2.Visible = True
exit do
End If
End If
Else
lblDscrpt.Caption = "Not Found"
lblCo = " "
imgUL.Visible = False
imgUL2.Visible = False
End If
Loop
End Sub
I'm not sure if that will help or not.... drop a line and let me know. k?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
I'm sending you an e-mail right now
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215