VERSION 5.00 Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" Begin VB.Form frmLotList Caption = "Lot Information List" ClientHeight = 8595 ClientLeft = 60 ClientTop = 7245 ClientWidth = 6975 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 8595 ScaleWidth = 6975 Begin VB.TextBox txtPreOrder Height = 285 Left = 6555 TabIndex = 16 Top = 2100 Visible = 0 'False Width = 435 End Begin LpLib.fpList lstPO Height = 1425 Left = 75 TabIndex = 15 Top = 2325 Width = 6855 _Version = 196608 _ExtentX = 12091 _ExtentY = 2514 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Enabled = -1 'True MousePointer = 0 Object.TabStop = -1 'True BackColor = -2147483643 ForeColor = -2147483640 Columns = 6 Sorted = 1 LineWidth = 1 SelDrawFocusRect= -1 'True ColumnSeparatorChar= 9 ColumnSearch = -1 ColumnWidthScale= 2 RowHeight = -1 MultiSelect = 0 WrapList = 0 'False WrapWidth = 0 SelMax = -1 AutoSearch = 1 SearchMethod = 0 VirtualMode = 0 'False VRowCount = 0 DataSync = 3 ThreeDInsideStyle= 1 ThreeDInsideHighlightColor= -2147483633 ThreeDInsideShadowColor= -2147483627 ThreeDInsideWidth= 1 ThreeDOutsideStyle= 1 ThreeDOutsideHighlightColor= -2147483628 ThreeDOutsideShadowColor= -2147483632 ThreeDOutsideWidth= 1 ThreeDFrameWidth= 0 BorderStyle = 0 BorderColor = -2147483642 BorderWidth = 1 ThreeDOnFocusInvert= 0 'False ThreeDFrameColor= -2147483633 Appearance = 2 BorderDropShadow= 0 BorderDropShadowColor= -2147483632 BorderDropShadowWidth= 3 ScrollHScale = 2 ScrollHInc = 0 ColsFrozen = 0 ScrollBarV = 1 NoIntegralHeight= 0 'False HighestPrecedence= 0 AllowColResize = 0 AllowColDragDrop= 0 ReadOnly = 0 'False VScrollSpecial = 0 'False VScrollSpecialType= 0 EnableKeyEvents = -1 'True EnableTopChangeEvent= -1 'True DataAutoHeadings= -1 'True DataAutoSizeCols= 2 SearchIgnoreCase= -1 'True ScrollBarH = 1 VirtualPageSize = 0 VirtualPagesAhead= 0 ExtendCol = 0 ColumnLevels = 1 ListGrayAreaColor= -2147483637 GroupHeaderHeight= -1 GroupHeaderShow = 0 'False AllowGrpResize = 0 AllowGrpDragDrop= 0 MergeAdjustView = 0 'False ColumnHeaderShow= 0 'False ColumnHeaderHeight= -1 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmLotList2.frx":0000 End Begin LpLib.fpList lstInvoice Height = 1245 Left = 60 TabIndex = 12 Top = 7110 Width = 6855 _Version = 196608 _ExtentX = 12091 _ExtentY = 2196 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Enabled = -1 'True MousePointer = 0 Object.TabStop = 0 'False BackColor = -2147483643 ForeColor = -2147483640 Columns = 8 Sorted = 0 LineWidth = 1 SelDrawFocusRect= -1 'True ColumnSeparatorChar= 9 ColumnSearch = -1 ColumnWidthScale= 2 RowHeight = -1 MultiSelect = 0 WrapList = 0 'False WrapWidth = 0 SelMax = -1 AutoSearch = 1 SearchMethod = 0 VirtualMode = 0 'False VRowCount = 0 DataSync = 3 ThreeDInsideStyle= 1 ThreeDInsideHighlightColor= -2147483633 ThreeDInsideShadowColor= -2147483627 ThreeDInsideWidth= 1 ThreeDOutsideStyle= 1 ThreeDOutsideHighlightColor= -2147483628 ThreeDOutsideShadowColor= -2147483632 ThreeDOutsideWidth= 1 ThreeDFrameWidth= 0 BorderStyle = 0 BorderColor = -2147483642 BorderWidth = 1 ThreeDOnFocusInvert= 0 'False ThreeDFrameColor= -2147483633 Appearance = 2 BorderDropShadow= 0 BorderDropShadowColor= -2147483632 BorderDropShadowWidth= 3 ScrollHScale = 2 ScrollHInc = 0 ColsFrozen = 0 ScrollBarV = 1 NoIntegralHeight= 0 'False HighestPrecedence= 0 AllowColResize = 0 AllowColDragDrop= 0 ReadOnly = 0 'False VScrollSpecial = 0 'False VScrollSpecialType= 0 EnableKeyEvents = -1 'True EnableTopChangeEvent= -1 'True DataAutoHeadings= -1 'True DataAutoSizeCols= 2 SearchIgnoreCase= -1 'True ScrollBarH = 1 VirtualPageSize = 0 VirtualPagesAhead= 0 ExtendCol = 0 ColumnLevels = 1 ListGrayAreaColor= -2147483637 GroupHeaderHeight= -1 GroupHeaderShow = 0 'False AllowGrpResize = 0 AllowGrpDragDrop= 0 MergeAdjustView = 0 'False ColumnHeaderShow= -1 'True ColumnHeaderHeight= -1 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmLotList2.frx":03FF End Begin LpLib.fpList lstPOWO Height = 1065 Left = 60 TabIndex = 11 Top = 5700 Width = 6855 _Version = 196608 _ExtentX = 12091 _ExtentY = 1879 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Enabled = -1 'True MousePointer = 0 Object.TabStop = -1 'True BackColor = -2147483643 ForeColor = -2147483640 Columns = 6 Sorted = 0 LineWidth = 1 SelDrawFocusRect= -1 'True ColumnSeparatorChar= 9 ColumnSearch = -1 ColumnWidthScale= 2 RowHeight = -1 MultiSelect = 0 WrapList = 0 'False WrapWidth = 0 SelMax = -1 AutoSearch = 1 SearchMethod = 0 VirtualMode = 0 'False VRowCount = 0 DataSync = 3 ThreeDInsideStyle= 1 ThreeDInsideHighlightColor= -2147483633 ThreeDInsideShadowColor= -2147483627 ThreeDInsideWidth= 1 ThreeDOutsideStyle= 1 ThreeDOutsideHighlightColor= -2147483628 ThreeDOutsideShadowColor= -2147483632 ThreeDOutsideWidth= 1 ThreeDFrameWidth= 0 BorderStyle = 0 BorderColor = -2147483642 BorderWidth = 1 ThreeDOnFocusInvert= 0 'False ThreeDFrameColor= -2147483633 Appearance = 2 BorderDropShadow= 0 BorderDropShadowColor= -2147483632 BorderDropShadowWidth= 3 ScrollHScale = 2 ScrollHInc = 0 ColsFrozen = 0 ScrollBarV = 1 NoIntegralHeight= 0 'False HighestPrecedence= 0 AllowColResize = 0 AllowColDragDrop= 0 ReadOnly = 0 'False VScrollSpecial = 0 'False VScrollSpecialType= 0 EnableKeyEvents = -1 'True EnableTopChangeEvent= -1 'True DataAutoHeadings= -1 'True DataAutoSizeCols= 2 SearchIgnoreCase= -1 'True ScrollBarH = 1 VirtualPageSize = 0 VirtualPagesAhead= 0 ExtendCol = 0 ColumnLevels = 1 ListGrayAreaColor= -2147483637 GroupHeaderHeight= -1 GroupHeaderShow = 0 'False AllowGrpResize = 0 AllowGrpDragDrop= 0 MergeAdjustView = 0 'False ColumnHeaderShow= 0 'False ColumnHeaderHeight= -1 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmLotList2.frx":08A0 End Begin VB.CommandButton cmdSetYard Caption = "Setup Yard List" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 240 Left = 3427 TabIndex = 9 Top = 3795 Width = 1770 End Begin VB.CommandButton cmdYard Caption = "Yard Order" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 240 Left = 5565 TabIndex = 8 Top = 3795 Width = 1320 End Begin VB.CommandButton cmdExit Caption = "E&xit" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 240 Left = 2145 TabIndex = 7 Top = 3795 Width = 915 End Begin VB.ListBox lstPayroll Height = 1425 Left = 60 TabIndex = 6 Top = 4095 Width = 6855 End Begin VB.ListBox lstPO2 Height = 1425 Left = 60 TabIndex = 5 Top = 2340 Visible = 0 'False Width = 6855 End Begin VB.ListBox lstRepairs Height = 1035 Left = 60 TabIndex = 2 Top = 1065 Width = 6855 End Begin VB.Label lblPOWOList AutoSize = -1 'True Caption = "Billable PO/WO 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 = 60 TabIndex = 14 Top = 5505 Width = 1710 End Begin VB.Label lblInvoiceList AutoSize = -1 'True Caption = "Invoice 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 = 60 TabIndex = 13 Top = 6900 Width = 1005 End Begin VB.Label lblMatPO AutoSize = -1 'True Caption = "Payroll Information" 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 = 60 TabIndex = 10 Top = 3780 Width = 1590 End Begin VB.Label lblPO AutoSize = -1 'True Caption = "Orders 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 = 60 TabIndex = 4 Top = 2130 Width = 930 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 = 60 TabIndex = 3 Top = 855 Width = 930 End Begin VB.Line Line1 BorderWidth = 3 X1 = 15 X2 = 6975 Y1 = 810 Y2 = 810 End Begin VB.Label lblLot 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 = 15 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 = 300 Left = 60 TabIndex = 0 Top = 360 Width = 6855 End End Attribute VB_Name = "frmLotList" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim mstrWTYPE As String, mstrWDone As String, mboolPROJ As Boolean Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdSetYard_Click() Dim oRS As Recordset, oRSS As Recordset Dim strSQL As String, strSql2 As String On Error GoTo Error_EH strSQL = "SELECT * FROM tblOrdMatrl WHERE not x_flag and Order_Id = " & lstPO.ItemData(lstPO.ListIndex) Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If Not oRS.EOF Then strSql2 = "SELECT * FROM tblYardOrder" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Else MsgBox "No Order Items to Process", vbOKOnly, "No Items" Exit Sub End If Do Until oRS.EOF With oRSS .AddNew !Lot_ID = oRS!Lot_ID !inv_no = oRS!inv_no !Desc = oRS!Desc !qty = oRS!o_qty !qtyIssue = oRS!o_qty !po_num = oRS!po_num !createuser = gstrLOGIN .Update oRS!x_flag = vbChecked oRS.Update oRS.MoveNext End With Loop Exit Sub Error_EH: gstrMODULE = "Form LotList - Module cmdSetYard" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdYard_Click() frmShowYardMat.Show 1 End Sub 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 Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 Call POWOLoad Call RepairLoad Call OrderLoad Call PayrollLoad Call InvoiceLoad 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 Dim lngRET As Long, aTabs(2) As Long On Error GoTo Error_EH aTabs(0) = 50 aTabs(1) = 95 aTabs(2) = 170 ' aTabs(3) = 190 strSQL = "SELECT Repair_id, Proj_lot, Scheduled, completed, punch, yrend1, yrend2, wo, repair, backcharge from tblrepair WHERE lot_id = " & gintLOTID & " ORDER BY scheduled" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lngRET = SendMessage(lstRepairs.hwnd, LB_SETTABSTOPS, 3, aTabs(0)) 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 = "WARRANTY" ElseIf oRS!backcharge Then strTYPE = "BACKCHARGE" Else strTYPE = "UNKNOWN" End If strLine = "" strLine = Field2Str(oRS!scheduled) & vbTab & Field2Str(oRS!completed) & vbTab ' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) ' 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 InvoiceLoad() Dim oRS As Recordset, strDONE As String Dim strSQL As String, strLine As String, strTYPE As String, strWORK As String, strINVT As String 'dim On Error GoTo Error_EH ' strSQL = "SELECT * FROM tblARINVOICE WHERE lot_id = " & gintLOTID & " ORDER BY INVOICE_DATE" strSQL = "SELECT * FROM tblARINVOICE WHERE lot_id = " & gintLOTID & " and not delete ORDER BY INVOICE_DATE" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstInvoice.Clear Do Until oRS.EOF With lstInvoice strINVT = oRS!inv_type If strINVT = "L" Then strTYPE = "LATH" ElseIf strINVT = "S" Then strTYPE = "STUCCO" ElseIf strINVT = "PE" Then strTYPE = "PAINT EXTERIOR" ElseIf strINVT = "PF" Then strTYPE = "PAINT FINAL" ElseIf strINVT = "PI" Then strTYPE = "PAINT INTERNAL" ElseIf strINVT = "V" Then strTYPE = "STONE" Else strTYPE = "UNKNOWN" End If ' mstrWDone = Field2Str(oRS!workdone) ' Call GetWorkType ' strWORK = mstrWTYPE If oRS!done And Not oRS!Delete Then strDONE = "CMS" Else strDONE = "" End If strLine = "" strLine = Field2Str2(oRS!Trans_ID) & vbTab & Field2Str(oRS!invoice_date) & vbTab strLine = strLine & Field2Str(oRS!invoice_no) & vbTab & Field2Str(strTYPE) & vbTab ' strLine = strLine & Field2Str(oRS!strWORK) & vbTab & Field2Str2(oRS!NON_TAX_AMT) ' & vbTab strLine = strLine & Field2Str(oRS!sales_code) & vbTab & Format(Field2Str2(oRS!amount), "#,#.00") strLine = strLine & vbTab & Format(Field2Str2(oRS!non_tax_amt), "#,#.00") & vbTab & strDONE ' strLine = strLine & Field2Str(oRS!SALES_CODE) & vbTab & Field2Str2(oRS!NON_TAX_AMT) ' & vbTab ' strLine = Field2Str(oRS!scheduled) & " " & Field2Str(oRS!completed) & " " ' strLine = strLine & strTYPE & vbTab & Field2Str(oRS!proj_lot) ' 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 InvoiceLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub GetWorkType() Dim strSQL As String, oRSW As Recordset strSQL = "SELECT * FROM tblcboWorkType WHERE WTCode = '" & mstrWDone & "'" Set oRSW = New Recordset oRSW.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSW.EOF Then mstrWTYPE = Field2Str(oRSW!worktype) End If oRSW.Close End Sub Private Sub PayrollLoad() Dim oRS As Recordset Dim strSQL As String, strLine As String, strTYPE As String, strWORK As String Dim lngRET As Long, aTabs(3) As Long On Error GoTo Error_EH aTabs(0) = 40 aTabs(1) = 120 aTabs(2) = 145 aTabs(3) = 190 strSQL = "SELECT * FROM tblTime WHERE lot_id = " & gintLOTID ' & " ORDER BY Order_Date" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lngRET = SendMessage(lstPayroll.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) lstPayroll.Clear Do Until oRS.EOF With lstPayroll If Field2Str(oRS!pay_type) = "L" Then strTYPE = "LATH" ElseIf Field2Str(oRS!pay_type) = "C" Then strTYPE = "SCAFFOLD" ElseIf Field2Str(oRS!pay_type) = "S" Then strTYPE = "STUCCO" ElseIf Field2Str(oRS!pay_type) = "Y" Then strTYPE = "SYNTHETIC" ElseIf Field2Str(oRS!pay_type) = "V" Then strTYPE = "STONE" ElseIf Field2Str(oRS!pay_type) = "X" Then strTYPE = "PAINT" End If mstrWDone = Field2Str(oRS!WorkDone) Call GetWorkType strWORK = mstrWTYPE ' If Field2Str(oRS!workdone) = "C" Then ' strWORK = "COMPLETE" ' ElseIf Field2Str(oRS!workdone) = "B" Then ' strWORK = "BROWN" ' ElseIf Field2Str(oRS!workdone) = "F" Then ' strWORK = "FENCE" ' ElseIf Field2Str(oRS!workdone) = "T" Then ' strWORK = "TEXTURE" ' ElseIf Field2Str(oRS!workdone) = "W" Then ' strWORK = "WORK ORDER" ' ElseIf Field2Str(oRS!workdone) = "U" Then ' strWORK = "CMU WALL" ' ElseIf Field2Str(oRS!workdone) = "P" Then ' strWORK = "PARTIAL" ' ElseIf Field2Str(oRS!workdone) = "R" Then ' strWORK = "REPAIR" ' ElseIf Field2Str(oRS!workdone) = "S" Then ' strWORK = "SCRATCH" ' ElseIf Field2Str(oRS!workdone) = "Z" Then ' strWORK = "DOWN" ' ElseIf Field2Str(oRS!workdone) = "Y" Then ' strWORK = "UP" ' End If strLine = strTYPE & vbTab & strWORK & vbTab strLine = strLine & Field2Str(oRS!paydt) & vbTab & Format(Field2Str(oRS!pay_amt), "#,#.00") ' strLine = strLine & Field2Str(oRS!prdate) & vbTab & Format(Field2Str(oRS!pay_amt), "#,#.00") .AddItem strLine .ItemData(.NewIndex) = Field2Long(oRS!idnum) End With oRS.MoveNext Loop oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotList - Module PayrollLoad" 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 OrderLoad() Dim oRS As Recordset Dim strSQL As String, strLine As String Dim strTYPE As String, strDESC As String Dim lngRET As Long, aTabs(3) As Long On Error GoTo Error_EH ' aTabs(0) = 45 ' aTabs(1) = 70 ' aTabs(2) = 145 ' aTabs(3) = 190 strSQL = "SELECT order_id, ponum, m_type, po_num, order_date, supplier from tblOrders WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly ' lngRET = SendMessage(lstPO.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) lstPO.Clear Do Until oRS.EOF With lstPO Call SetType(oRS!m_type, strDESC) strLine = Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!ponum) & vbTab strLine = strLine & Field2Str(oRS!po_num) & vbTab & strDESC & vbTab & Field2Str(oRS!supplier) & vbTab & Field2Str2(oRS!order_id) .AddItem strLine ' .ItemData(.NewIndex) = oRS!order_id End With oRS.MoveNext Loop oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotList - Module OrderLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub OrderLoadHold() Dim oRS As Recordset Dim strSQL As String, strLine As String Dim strTYPE As String, strDESC As String Dim lngRET As Long, aTabs(3) As Long On Error GoTo Error_EH aTabs(0) = 45 aTabs(1) = 70 aTabs(2) = 145 aTabs(3) = 190 strSQL = "SELECT order_id, ponum, m_type, po_num, order_date, supplier from tblOrders WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lngRET = SendMessage(lstPO.hwnd, LB_SETTABSTOPS, 4, aTabs(0)) lstPO.Clear Do Until oRS.EOF With lstPO Call SetType(oRS!m_type, strDESC) strLine = Field2Str(oRS!order_date) & vbTab & Field2Str(oRS!ponum) & vbTab strLine = strLine & Field2Str(oRS!po_num) & vbTab & strDESC & vbTab & Field2Str(oRS!supplier) .AddItem strLine .ItemData(.NewIndex) = oRS!order_id End With oRS.MoveNext Loop oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotList - Module OrderLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShow() On Error GoTo Error_EH If lstRepairs.ListCount = 0 Then lstRepairs.Enabled = False Else lstRepairs.Enabled = True End If If lstInvoice.ListCount = 0 Then lstInvoice.Enabled = False Else lstInvoice.Enabled = True End If If lstPOWO.ListCount = 0 Then lstPOWO.Enabled = False Else lstPOWO.Enabled = True End If If lstPO.ListCount = 0 Then lstPO.Enabled = False Else lstPO.Enabled = True End If If lstPayroll.ListCount = 0 Then lstPayroll.Enabled = False Else lstPayroll.Enabled = True End If ' 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 = " & Field2Long(oRS!PROJ_ID) ' 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 lstInvoice_DblClick() MsgBox "Mouse has been DblClicked", vbOKOnly End Sub Private Sub lstPayroll_DblClick() lstPO.ListIndex = -1 lstRepairs.ListIndex = -1 Load frmPayroll frmPayroll.chkLOOK = vbChecked frmPayroll.Show 1 End Sub Private Sub lstPO_DblClick() Dim oRS As Recordset, strTYPE As String Dim strSQL As String, boolPREORDER As Boolean ' Load frmShowOrderMat boolPREORDER = False lstPayroll.ListIndex = -1 lstRepairs.ListIndex = -1 lstPO.col = 3 strTYPE = lstPO.ColText If strTYPE = "Z-PreCast" Or strTYPE = "PreOrder" Then boolPREORDER = True Else boolPREORDER = False End If lstPO.col = 5 glngORDERID = lstPO.ColText strSQL = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If oRS!ponum > 0 Then glngORDERID = Field2Long(oRS!ponum) frmShowPO.Show 1 ElseIf boolPREORDER Then If strTYPE = "Z-PreCast" Then txtPreOrder = "Z" ' frmShowOrderMat.txtPreOrder = "Z" ElseIf strTYPE = "PreOrder" Then txtPreOrder = "P" ' frmShowOrderMat.txtPreOrder = "P" Else txtPreOrder = "" End If frmShowOrderMat.Show 1 Else txtPreOrder = "" frmShowOrderMat.Show 1 End If End Sub Private Sub lstPOHold_DblClick() Dim oRS As Recordset Dim strSQL As String lstPayroll.ListIndex = -1 lstRepairs.ListIndex = -1 glngORDERID = lstPO.ItemData(lstPO.ListIndex) strSQL = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If oRS!ponum > 0 Then glngORDERID = Field2Long(oRS!ponum) frmShowPO.Show 1 Else ' glngORDERID = 0 frmShowOrderMat.Show 1 End If End Sub Private Sub lstPOWO_DblClick() lstPO.ListIndex = -1 lstRepairs.ListIndex = -1 lstPayroll.ListIndex = -1 lstInvoice.ListIndex = -1 lstPOWO.col = 0 gintREPAIRID = Field2Str2(lstPOWO.ColText) Load frmPOWOLot frmPOWOLot.chkLOOK = vbChecked frmPOWOLot.Show 1 End Sub Private Sub lstRepairs_DblClick() lstPayroll.ListIndex = -1 lstPO.ListIndex = -1 gintREPAIRID = lstRepairs.ItemData(lstRepairs.ListIndex) frmShowRepair.Show 1 End Sub Private Sub POWOLoad() Dim oRS As Recordset, intYN As Integer Dim strSQL As String Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT * FROM tblPOWO WHERE LOT_ID = " & gintLOTID ' & "'" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstPOWO.Clear Do Until oRS.EOF With lstPOWO strLine = Field2Str(oRS!repair_id) & vbTab & Field2Str(oRS!builder_PO) & vbTab & Field2Str(oRS!invoice_no) & vbTab & Field2Str(oRS!Desc) .AddItem strLine End With oRS.MoveNext Loop If lstPOWO.ListCount Then lstPOWO.ListIndex = 0 mboolPROJ = False lstPOWO.Enabled = True Else lstPOWO.ListIndex = -1 lstPOWO.Enabled = False ' Call FormClear End If Exit Sub Error_EH: gstrMODULE = "FormLotList - Module POWOLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub