378 lines
10 KiB
Plaintext
378 lines
10 KiB
Plaintext
VERSION 5.00
|
|
Begin VB.Form frmLotList3
|
|
Caption = "Lot Information List"
|
|
ClientHeight = 8595
|
|
ClientLeft = 60
|
|
ClientTop = 345
|
|
ClientWidth = 6975
|
|
LinkTopic = "Form1"
|
|
MaxButton = 0 'False
|
|
MinButton = 0 'False
|
|
ScaleHeight = 8595
|
|
ScaleWidth = 6975
|
|
StartUpPosition = 3 'Windows Default
|
|
Begin VB.ListBox lstMatPO
|
|
Height = 1425
|
|
Left = 60
|
|
TabIndex = 7
|
|
Top = 4200
|
|
Width = 6855
|
|
End
|
|
Begin VB.ListBox lstPO
|
|
Height = 1230
|
|
Left = 60
|
|
TabIndex = 5
|
|
Top = 2580
|
|
Width = 6855
|
|
End
|
|
Begin VB.ListBox lstRepairs
|
|
Height = 1035
|
|
Left = 60
|
|
TabIndex = 2
|
|
Top = 1200
|
|
Width = 6855
|
|
End
|
|
Begin VB.Label lblMatPO
|
|
AutoSize = -1 'True
|
|
Caption = "Material Purchase Orders"
|
|
BeginProperty Font
|
|
Name = "MS Sans Serif"
|
|
Size = 8.25
|
|
Charset = 0
|
|
Weight = 700
|
|
Underline = 0 'False
|
|
Italic = 0 'False
|
|
Strikethrough = 0 'False
|
|
EndProperty
|
|
Height = 195
|
|
Left = 120
|
|
TabIndex = 6
|
|
Top = 3900
|
|
Width = 2160
|
|
End
|
|
Begin VB.Label lblPO
|
|
AutoSize = -1 'True
|
|
Caption = "Special Purchase Orders"
|
|
BeginProperty Font
|
|
Name = "MS Sans Serif"
|
|
Size = 8.25
|
|
Charset = 0
|
|
Weight = 700
|
|
Underline = 0 'False
|
|
Italic = 0 'False
|
|
Strikethrough = 0 'False
|
|
EndProperty
|
|
Height = 195
|
|
Left = 120
|
|
TabIndex = 4
|
|
Top = 2340
|
|
Width = 2115
|
|
End
|
|
Begin VB.Label lblRepairs
|
|
AutoSize = -1 'True
|
|
Caption = "Repair List"
|
|
BeginProperty Font
|
|
Name = "MS Sans Serif"
|
|
Size = 8.25
|
|
Charset = 0
|
|
Weight = 700
|
|
Underline = 0 'False
|
|
Italic = 0 'False
|
|
Strikethrough = 0 'False
|
|
EndProperty
|
|
Height = 195
|
|
Left = 120
|
|
TabIndex = 3
|
|
Top = 960
|
|
Width = 930
|
|
End
|
|
Begin VB.Line Line1
|
|
BorderWidth = 3
|
|
X1 = 0
|
|
X2 = 6960
|
|
Y1 = 900
|
|
Y2 = 900
|
|
End
|
|
Begin VB.Label Label3
|
|
Alignment = 2 'Center
|
|
Caption = "Lot Information"
|
|
BeginProperty Font
|
|
Name = "MS Sans Serif"
|
|
Size = 13.5
|
|
Charset = 0
|
|
Weight = 700
|
|
Underline = 0 'False
|
|
Italic = 0 'False
|
|
Strikethrough = 0 'False
|
|
EndProperty
|
|
Height = 315
|
|
Left = 60
|
|
TabIndex = 1
|
|
Top = 60
|
|
Width = 6795
|
|
End
|
|
Begin VB.Label lblProjLot
|
|
Alignment = 2 'Center
|
|
BorderStyle = 1 'Fixed Single
|
|
BeginProperty Font
|
|
Name = "MS Sans Serif"
|
|
Size = 9.75
|
|
Charset = 0
|
|
Weight = 700
|
|
Underline = 0 'False
|
|
Italic = 0 'False
|
|
Strikethrough = 0 'False
|
|
EndProperty
|
|
Height = 375
|
|
Left = 60
|
|
TabIndex = 0
|
|
Top = 480
|
|
Width = 6855
|
|
End
|
|
End
|
|
Attribute VB_Name = "frmLotList3"
|
|
Attribute VB_GlobalNameSpace = False
|
|
Attribute VB_Creatable = False
|
|
Attribute VB_PredeclaredId = True
|
|
Attribute VB_Exposed = False
|
|
Option Explicit
|
|
|
|
Private Sub Form_Activate()
|
|
Dim intResponse As Integer
|
|
Dim strSQL As String
|
|
|
|
On Error GoTo Error_EH
|
|
|
|
Exit Sub
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module Form_Activate"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Sub
|
|
|
|
End Sub
|
|
|
|
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
|
|
|
|
If Shift = 4 Then
|
|
Exit Sub
|
|
End If
|
|
|
|
End Sub
|
|
Private Sub Form_KeyPress(KeyAscii As Integer)
|
|
If KeyAscii = 13 Then
|
|
SendKeys "{TAB}"
|
|
KeyAscii = 0
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub Form_Load()
|
|
On Error GoTo Error_EH
|
|
|
|
Call POLoad
|
|
Call RepairLoad
|
|
Call MatPOLoad
|
|
If FormFind() Then
|
|
Call FormShow
|
|
Else
|
|
Unload Me
|
|
End If
|
|
|
|
Exit Sub
|
|
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module Form_Load"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Sub
|
|
End Sub
|
|
|
|
Private Sub RepairLoad()
|
|
Dim oRS As Recordset
|
|
Dim strSQL As String, strLine As String, strTYPE As String
|
|
On Error GoTo Error_EH
|
|
|
|
strSQL = "SELECT Repair_id, Proj_lot, Scheduled, completed, punch, yrend1, yrend2, wo, repair from tblrepair WHERE lot_id = " & gintLOTID & " ORDER BY scheduled"
|
|
Set oRS = New Recordset
|
|
oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly
|
|
|
|
lstRepairs.Clear
|
|
|
|
Do Until oRS.EOF
|
|
With lstRepairs
|
|
If oRS!punch Then
|
|
strTYPE = "PUNCH "
|
|
ElseIf oRS!yrend1 Then
|
|
strTYPE = "1 YEAR END"
|
|
ElseIf oRS!yrend2 Then
|
|
strTYPE = "2 YEAR END"
|
|
ElseIf oRS!wo Then
|
|
strTYPE = "PO WORK "
|
|
ElseIf oRS!repair Then
|
|
strTYPE = "REPAIR "
|
|
End If
|
|
strLine = ""
|
|
strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " "
|
|
strLine = strLine & strTYPE & " " & Field2Str(oRS!proj_lot)
|
|
.AddItem strLine
|
|
.ItemData(.NewIndex) = oRS!repair_id
|
|
End With
|
|
oRS.MoveNext
|
|
Loop
|
|
oRS.Close
|
|
|
|
Exit Sub
|
|
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module RepairLoad"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Sub
|
|
End Sub
|
|
|
|
Private Sub MatPOLoad()
|
|
Dim oRS As Recordset
|
|
Dim strSQL As String, strLine As String, strTYPE As String
|
|
On Error GoTo Error_EH
|
|
|
|
strSQL = "SELECT lot_id, order_date, m_type, po_num FROM tblOrders WHERE ponum = 0 and lot_id = " & gintLOTID & " ORDER BY Order_Date"
|
|
Set oRS = New Recordset
|
|
oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly
|
|
|
|
lstMatPO.Clear
|
|
|
|
Do Until oRS.EOF
|
|
With lstMatPO
|
|
If Field2Str(oRS!m_type) = "L" Then
|
|
strTYPE = "LATH "
|
|
ElseIf Field2Str(oRS!m_type) = "B" Then
|
|
strTYPE = "BROWN "
|
|
ElseIf Field2Str(oRS!m_type) = "A" Then
|
|
strTYPE = "SAND "
|
|
ElseIf Field2Str(oRS!m_type) = "T" Then
|
|
strTYPE = "TEXTURE "
|
|
ElseIf Field2Str(oRS!m_type) = "P" Then
|
|
strTYPE = "PREORDER"
|
|
ElseIf Field2Str(oRS!m_type) = "S" Then
|
|
strTYPE = "SCRATCH "
|
|
End If
|
|
strLine = strTYPE & vbTab & Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!po_num)
|
|
.AddItem strLine
|
|
.ItemData(.NewIndex) = oRS!lot_id
|
|
End With
|
|
oRS.MoveNext
|
|
Loop
|
|
oRS.Close
|
|
|
|
Exit Sub
|
|
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module MatPOLoad"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Sub
|
|
End Sub
|
|
|
|
Private Sub POLoad()
|
|
Dim oRS As Recordset
|
|
Dim strSQL As String, strLine As String
|
|
On Error GoTo Error_EH
|
|
|
|
strSQL = "SELECT ponum, towhom, desc, date from tblPOrder WHERE lot_id = " & gintLOTID
|
|
Set oRS = New Recordset
|
|
oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly
|
|
|
|
lstPO.Clear
|
|
|
|
Do Until oRS.EOF
|
|
With lstPO
|
|
strLine = Field2Str(oRS!Date) & vbTab & Field2Str(oRS!ponum) & vbTab
|
|
strLine = strLine & Field2Str(oRS!towhom) & vbTab & Field2Str(oRS!Desc)
|
|
.AddItem strLine
|
|
.ItemData(.NewIndex) = oRS!ponum
|
|
End With
|
|
oRS.MoveNext
|
|
Loop
|
|
oRS.Close
|
|
|
|
Exit Sub
|
|
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module POLoad"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Sub
|
|
End Sub
|
|
|
|
Private Sub FormShow()
|
|
On Error GoTo Error_EH
|
|
|
|
' mboolSHOW = True
|
|
' mboolSHOW = False
|
|
Exit Sub
|
|
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module FormShow"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Sub
|
|
End Sub
|
|
|
|
Private Function FormFind() As Boolean
|
|
Dim strSQL As String, strProj As String, strMEMO As String
|
|
Dim oRS As Recordset, oRSS As Recordset
|
|
|
|
On Error GoTo Error_EH
|
|
|
|
strSQL = "SELECT * "
|
|
strSQL = strSQL & "FROM tblLotInfo "
|
|
strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID
|
|
Set oRS = New Recordset
|
|
oRS.Open strSQL, goConn, _
|
|
adOpenKeyset, adLockPessimistic
|
|
|
|
strProj = "SELECT * "
|
|
strProj = strProj & "FROM tblproject "
|
|
strProj = strProj & "WHERE proj_ID = " & Field2Integer(oRS!proj_id)
|
|
Set oRSS = New Recordset
|
|
oRSS.Open strProj, goConn, _
|
|
adOpenKeyset, adLockPessimistic
|
|
|
|
If oRSS.EOF Then
|
|
|
|
End If
|
|
|
|
If oRS.EOF Then
|
|
FormFind = False
|
|
Else
|
|
FormFind = True
|
|
lblProjLot.Caption = oRSS!proj_code & " " & oRS!lot_no & " " & oRSS!proj_desc
|
|
End If
|
|
oRS.Close
|
|
oRSS.Close
|
|
Exit Function
|
|
|
|
Error_EH:
|
|
gstrMODULE = "Form LotList - Module FormFind"
|
|
Call ErrorHandler2
|
|
gstrMODULE = ""
|
|
Exit Function
|
|
End Function
|
|
|
|
Private Sub lstPO_DblClick()
|
|
gintPONUM = lstPO.ItemData(lstPO.ListIndex)
|
|
frmShowPO.Show 1
|
|
|
|
End Sub
|
|
|
|
Private Sub lstRepairs_DblClick()
|
|
' If Not lstRepairs.ListIndex Then
|
|
' Else
|
|
' MsgBox "There are no Repairs Listed", vbOKOnly, "No Repairs"
|
|
' Exit Sub
|
|
' End If
|
|
gintREPAIRID = lstRepairs.ItemData(lstRepairs.ListIndex)
|
|
frmShowRepair.Show 1
|
|
End Sub
|