The Access DB has 50 Columns of for data Labeled 1 through 50 + one date Field
I have looked but have been unsuccessful in finding anything that can help.
Imports System.IO
Public Class FirstShiftCheckListForm
Dim strlines() As String
Dim strline() As String
Dim strarray(,) As String
Dim num_rows As Integer
Dim num_cols As Integer
Dim xAxis As Integer = 50
Private Sub LoadDB()
End Sub
Private Sub FirstShiftCheckListForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strfilename As String ' to be used as the location of the File Name
Dim x As Integer
Dim y As Integer
' Load the file.
strfilename = "C:\ef53734\OperatorChecklist\Checklists\FirstShift.txt"
'Check if file exist
Try
If File.Exists(strfilename) Then
Dim sr As StreamReader = File.OpenText(strfilename)
'Load content of file to strLines array
strlines = sr.ReadToEnd().Split(Environment.NewLine)
' Redimension the array.
num_rows = UBound(strlines)
strline = strlines(0).Split(Chr(9))
num_cols = UBound(strline)
ReDim strarray(num_rows, num_cols)
' Loads the data into the array, and builds the Link lables on the page.
For x = 1 To num_rows
strline = strlines(x).Split(Chr(9))
For y = 0 To num_cols
strarray(x, y) = strline(y)
Next
AddTextLabel(y, strarray(x, 0), strarray(x, 1), strarray(x, 2))
Next
sr.Close()
End If
'Place move the save button here
LoadDB()
Catch ex As Exception
End Try
End Sub
Sub AddTextBox(ByVal DBLabel As String)
Dim myTextBox As New TextBox
myTextBox.Size = New System.Drawing.Size(85, 22)
myTextBox.Location = New Point(15, xAxis)
myTextBox.Name = DBLabel
Me.Controls.Add(myTextBox)
End Sub
Sub AddTextLabel(ByVal Y As Integer, ByVal DBLabel As String, ByVal Text1 As Integer, ByVal Text2 As String)
Dim myLabel As New Label
Dim Time As String
If Text1 = 0 Then
Time = CStr("")
myLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Else
AddTextBox(DBLabel)
Time = CStr(Format(Text1, "00:00"))
End If
myLabel.Text = Time + (" ") + Text2
myLabel.AutoSize = True
myLabel.Location = New Point(100, xAxis)
xAxis = xAxis + 28
Me.Controls.Add(myLabel)
End Sub
End Class
Tab Deliminated
[SampleData]
0 Time Task
1 700 "Complete any pending Daily Tape Management sheets print all labels, chg f=lble (etc) to f=3lbl prt=local or opshq008"
2 700 "BOTH printer settings match paper setting on printer (both should have punch, unless you are printing special forms)"
3 700 "Walkabout ALL ROOMS looking for trouble/problems/air conditioners, etc.
[/SampleData]

New Topic/Question
Reply




MultiQuote







|