|
-
May 19th, 2005, 07:06 AM
#1
[RESOLVED] Pulling from a text document, yet no value?
I am trying to pull 3 different values from a text document in the format of
1 value per line.
IE) 6
19
6/12/2005
It pulls the first and last values out, but I seems to refuse to pull out the middle value.
my code is as follows
VB Code:
Private Sub Form_Load()
Dim DatesLength As Integer
Open "H:\JOB\Dates.txt" For Input As #1
PayIncreaseComboBox.Value = Input(2, #1)
ShowLabels
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Visible = True Then
If ctl.Name Like "DTPicker*" Then
DatesLength = Val(Input(2, #1))
MsgBox (DatesLength)
ctl.Value = Input(DatesLength, #1)
End If
End If
Next
Close #1
End Sub
Anyone have any ideas?
Last edited by kfcSmitty; May 19th, 2005 at 07:31 AM.
-
May 19th, 2005, 07:19 AM
#2
Re: Pulling from a text document, yet no value?
Grab the whole file and split out by line:
VB Code:
Dim lines() as string
Dim tmp as string
Open "H:\JOB\Dates.txt" For Input As #1
tmp = input(lof(1),1)
Close #1
lines = Split(tmp,vbcrlf)
'the following will be the values of lines()
lines(0) = 6
Lines(1) = 19
lines(2) = 6/12/2005
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
May 19th, 2005, 07:30 AM
#3
Re: Pulling from a text document, yet no value?
Thank you soooo much!
The code you gave me even lets me omit some of the data i have in the text document!!
-
May 19th, 2005, 07:37 AM
#4
Re: [RESOLVED] Pulling from a text document, yet no value?
Glad to help
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|