Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21246

textbox to file name trouble

$
0
0
I am making a patient roster program that lists the patients for a specific day:

Code:

Private Sub Form_Load()
dat$ = Date
Text1.Text = Format$(dat$, "MM-DD-YYYY")
ff$ = "M:\recep\PT30415.txt"
Open ff$ For Random As #2 Len = 80
Max = 100
Dim w As String * 80
Dim pn$(100), ti$(100), ne$(100)
ptnum = LOF(2) / 80
Open "c:\test\text.txt" For Output As #1
For rn = 1 To LOF(2) / 80
    Get #2, rn, w
    w = Left(w, 58)
    w = Str(rn) + " " + w
    If rn < 10 Then
    w = " " + w
    End If
    pn$(rn) = Mid(w, 1, 25)
    ti$(rn) = Mid(w, 26, 5)
    ne$(rn) = Mid(w, 31, 25)
Print #1, pn$(rn); ">"; ti$(rn); ">"; ne$(rn)
List1.AddItem (w)
List1.TopIndex = List1.ListCount - 1

Next rn
Close #1
 
End Sub

I would like to make it so that if you type a specific date into the textbox 1 you xcan view that dates file.

todays files for example is M:\recep\PT30415.txt
tomorrows would be pt30416.txt

in june first it would be pt30601.txt

how do i get It to recognize the date i enter and load the apropriate file

Viewing all articles
Browse latest Browse all 21246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>