VERSION 5.00 Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" Begin VB.Form frmLotInfo BorderStyle = 1 'Fixed Single Caption = "Lot Information" ClientHeight = 8625 ClientLeft = 45 ClientTop = 225 ClientWidth = 11910 ControlBox = 0 'False KeyPreview = -1 'True LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 8625 ScaleWidth = 11910 Begin VB.TextBox txtStoneBill Alignment = 1 'Right Justify Height = 330 Left = 8640 TabIndex = 226 TabStop = 0 'False Top = 420 Visible = 0 'False Width = 540 End Begin VB.CheckBox chkFirst Caption = "First Time" Height = 315 Left = 10680 TabIndex = 211 Top = 1500 Visible = 0 'False Width = 315 End Begin VB.TextBox txtESTID Height = 375 Left = 3120 TabIndex = 207 Top = 1680 Visible = 0 'False Width = 735 End Begin VB.TextBox txtOPEN Height = 285 Left = 10740 TabIndex = 206 Top = 1140 Visible = 0 'False Width = 855 End Begin VB.TextBox txtJC Enabled = 0 'False Height = 315 Left = 2700 MaxLength = 7 TabIndex = 8 Top = 2220 Width = 915 End Begin VB.Timer tmrPause Enabled = 0 'False Interval = 500 Left = 8700 Top = 1020 End Begin Crystal.CrystalReport crOrder Left = 120 Top = 960 _ExtentX = 741 _ExtentY = 741 _Version = 348160 WindowControlBox= -1 'True WindowMaxButton = -1 'True WindowMinButton = -1 'True WindowState = 2 PrintFileLinesPerPage= 60 End Begin VB.TextBox txtSand Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 5160 TabIndex = 28 TabStop = 0 'False Top = 780 Width = 420 End Begin VB.ListBox lstPlans Height = 2010 Left = 9240 Sorted = -1 'True TabIndex = 26 TabStop = 0 'False Top = 1080 Visible = 0 'False Width = 1215 End Begin VB.CommandButton cmdFindPlan Height = 435 Left = 2565 Picture = "frmLotInfo.frx":0000 Style = 1 'Graphical TabIndex = 7 Top = 1410 Width = 435 End Begin VB.TextBox txtOneKote Enabled = 0 'False Height = 315 Left = 9240 TabIndex = 24 TabStop = 0 'False Top = 420 Width = 2475 End Begin VB.TextBox txtFinish Enabled = 0 'False Height = 315 Left = 9240 TabIndex = 22 TabStop = 0 'False Top = 45 Width = 2475 End Begin VB.TextBox txtNotes Height = 1020 Left = 3900 MultiLine = -1 'True TabIndex = 11 Top = 1515 Width = 4635 End Begin VB.TextBox txtFin2 Alignment = 1 'Right Justify Height = 315 Left = 5760 MaxLength = 3 TabIndex = 10 Top = 420 Width = 600 End Begin VB.TextBox txtTtlYdge Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 1440 TabIndex = 20 TabStop = 0 'False Top = 1860 Width = 795 End Begin VB.TextBox txtCMUYdge Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 1440 TabIndex = 19 TabStop = 0 'False Top = 2220 Width = 795 End Begin VB.TextBox txt28Foam Alignment = 1 'Right Justify Height = 315 Left = 5760 MaxLength = 2 TabIndex = 9 Top = 60 Width = 600 End Begin VB.TextBox txtProject Enabled = 0 'False Height = 315 Left = 1440 TabIndex = 18 TabStop = 0 'False Top = 60 Width = 2895 End Begin VB.TextBox txtLotNo Enabled = 0 'False Height = 315 Left = 1440 MaxLength = 5 TabIndex = 5 Top = 1140 Width = 1095 End Begin VB.TextBox txtModel Height = 315 Left = 1440 MaxLength = 8 TabIndex = 6 Top = 1500 Width = 1095 End Begin VB.TextBox txtOwner Height = 315 Left = 1440 MaxLength = 15 TabIndex = 4 Top = 780 Width = 2895 End Begin VB.TextBox txtAddress Height = 315 Left = 1440 MaxLength = 30 TabIndex = 3 Top = 420 Width = 2895 End Begin TabDlg.SSTab SSTLotInfo Height = 5655 Left = 150 TabIndex = 30 TabStop = 0 'False Top = 2820 Width = 11595 _ExtentX = 20452 _ExtentY = 9975 _Version = 393216 Tabs = 7 TabsPerRow = 4 TabHeight = 520 TabCaption(0) = "&General Information" TabPicture(0) = "frmLotInfo.frx":0442 Tab(0).ControlEnabled= -1 'True Tab(0).Control(0)= "lblDiana" Tab(0).Control(0).Enabled= 0 'False Tab(0).Control(1)= "lblYardMemo" Tab(0).Control(1).Enabled= 0 'False Tab(0).Control(2)= "lblMetal" Tab(0).Control(2).Enabled= 0 'False Tab(0).Control(3)= "lblLathBill" Tab(0).Control(3).Enabled= 0 'False Tab(0).Control(4)= "lblTextureO" Tab(0).Control(4).Enabled= 0 'False Tab(0).Control(5)= "lblBrownO" Tab(0).Control(5).Enabled= 0 'False Tab(0).Control(6)= "lblScratchO" Tab(0).Control(6).Enabled= 0 'False Tab(0).Control(7)= "lblSandO" Tab(0).Control(7).Enabled= 0 'False Tab(0).Control(8)= "lblLathO" Tab(0).Control(8).Enabled= 0 'False Tab(0).Control(9)= "lblOrderDates" Tab(0).Control(9).Enabled= 0 'False Tab(0).Control(10)= "txtLotNotes" Tab(0).Control(10).Enabled= 0 'False Tab(0).Control(11)= "cmdShowChange" Tab(0).Control(11).Enabled= 0 'False Tab(0).Control(12)= "cmdPrintCMU" Tab(0).Control(12).Enabled= 0 'False Tab(0).Control(13)= "cmdUpCMU" Tab(0).Control(13).Enabled= 0 'False Tab(0).Control(14)= "txtYardMemo" Tab(0).Control(14).Enabled= 0 'False Tab(0).Control(15)= "cmdEdit" Tab(0).Control(15).Enabled= 0 'False Tab(0).Control(16)= "cmdSuperRpt" Tab(0).Control(16).Enabled= 0 'False Tab(0).Control(17)= "txtMetal" Tab(0).Control(17).Enabled= 0 'False Tab(0).Control(18)= "cmdDelLot" Tab(0).Control(18).Enabled= 0 'False Tab(0).Control(19)= "cmdAddLot" Tab(0).Control(19).Enabled= 0 'False Tab(0).Control(20)= "txtLathBill" Tab(0).Control(20).Enabled= 0 'False Tab(0).Control(21)= "txtTextureO" Tab(0).Control(21).Enabled= 0 'False Tab(0).Control(22)= "txtBrownO" Tab(0).Control(22).Enabled= 0 'False Tab(0).Control(23)= "txtScratchO" Tab(0).Control(23).Enabled= 0 'False Tab(0).Control(24)= "txtSandO" Tab(0).Control(24).Enabled= 0 'False Tab(0).Control(25)= "txtLathO" Tab(0).Control(25).Enabled= 0 'False Tab(0).Control(26)= "cmdSaveLotInfo" Tab(0).Control(26).Enabled= 0 'False Tab(0).Control(27)= "cmdOrders" Tab(0).Control(27).Enabled= 0 'False Tab(0).Control(28)= "cmdExit" Tab(0).Control(28).Enabled= 0 'False Tab(0).Control(29)= "cmdCalc" Tab(0).Control(29).Enabled= 0 'False Tab(0).Control(30)= "cmdJCSetup" Tab(0).Control(30).Enabled= 0 'False Tab(0).Control(31)= "chkHoldOrders" Tab(0).Control(31).Enabled= 0 'False Tab(0).Control(32)= "chkHoldPO" Tab(0).Control(32).Enabled= 0 'False Tab(0).Control(33)= "chkSynthetic" Tab(0).Control(33).Enabled= 0 'False Tab(0).Control(34)= "cmdOrder" Tab(0).Control(34).Enabled= 0 'False Tab(0).Control(35)= "chkStone" Tab(0).Control(35).Enabled= 0 'False Tab(0).Control(36)= "cmdPrint" Tab(0).Control(36).Enabled= 0 'False Tab(0).Control(37)= "chkOthers" Tab(0).Control(37).Enabled= 0 'False Tab(0).Control(38)= "chkNoPay" Tab(0).Control(38).Enabled= 0 'False Tab(0).Control(39)= "chkPaint" Tab(0).Control(39).Enabled= 0 'False Tab(0).ControlCount= 40 TabCaption(1) = "&Super's Orders" TabPicture(1) = "frmLotInfo.frx":045E Tab(1).ControlEnabled= 0 'False Tab(1).Control(0)= "cmdPreOrderPrintPC" Tab(1).Control(1)= "cmdIssue" Tab(1).Control(2)= "cmdLFlag" Tab(1).Control(3)= "txtTake138" Tab(1).Control(3).Enabled= 0 'False Tab(1).Control(4)= "txtSuperBB" Tab(1).Control(5)= "txtSuper12" Tab(1).Control(6)= "txtSuper783" Tab(1).Control(7)= "txtSuper78" Tab(1).Control(8)= "txtSuper38" Tab(1).Control(9)= "txtSuper1383" Tab(1).Control(10)= "txtSuperRL" Tab(1).Control(11)= "txtSuperML" Tab(1).Control(12)= "txtSuperDW" Tab(1).Control(13)= "txtSuperSP" Tab(1).Control(14)= "lstPreOrder" Tab(1).Control(14).Enabled= 0 'False Tab(1).Control(15)= "txtCalc138" Tab(1).Control(15).Enabled= 0 'False Tab(1).Control(16)= "cmdPreOrderPrintY" Tab(1).Control(16).Enabled= 0 'False Tab(1).Control(17)= "cmdPreOrderPrintS" Tab(1).Control(17).Enabled= 0 'False Tab(1).Control(18)= "txtSuperNotes" Tab(1).Control(19)= "cmdLathPay" Tab(1).Control(20)= "cmdStuccoPay" Tab(1).Control(21)= "cmdRePrintL" Tab(1).Control(22)= "lblZMetal" Tab(1).Control(23)= "lblBB" Tab(1).Control(24)= "lblTake138" Tab(1).Control(25)= "lblSuperBB" Tab(1).Control(26)= "linSO" Tab(1).Control(27)= "lblSuper12" Tab(1).Control(28)= "lblSuper783" Tab(1).Control(29)= "lblSuper78" Tab(1).Control(30)= "lblSuper38" Tab(1).Control(31)= "lblSuper138" Tab(1).Control(32)= "lblSuperML" Tab(1).Control(33)= "lblSuperRL" Tab(1).Control(34)= "lblSuperDW" Tab(1).Control(35)= "lblSuperSP" Tab(1).Control(36)= "lblSupHelp" Tab(1).Control(37)= "lblPreOrder" Tab(1).Control(38)= "lblSuperNotes" Tab(1).ControlCount= 39 TabCaption(2) = "&Materials" TabPicture(2) = "frmLotInfo.frx":047A Tab(2).ControlEnabled= 0 'False Tab(2).Control(0)= "lblMatInst" Tab(2).Control(0).Enabled= 0 'False Tab(2).Control(1)= "lblOrderBalance" Tab(2).Control(1).Enabled= 0 'False Tab(2).Control(2)= "lblLMLength" Tab(2).Control(2).Enabled= 0 'False Tab(2).Control(3)= "lblLMetal" Tab(2).Control(3).Enabled= 0 'False Tab(2).Control(4)= "lblLMType" Tab(2).Control(4).Enabled= 0 'False Tab(2).Control(5)= "lblLMDFlag" Tab(2).Control(5).Enabled= 0 'False Tab(2).Control(6)= "lblQty" Tab(2).Control(6).Enabled= 0 'False Tab(2).Control(7)= "lblLMInvNo" Tab(2).Control(7).Enabled= 0 'False Tab(2).Control(8)= "lblLMDesc" Tab(2).Control(8).Enabled= 0 'False Tab(2).Control(9)= "chkChange" Tab(2).Control(9).Enabled= 0 'False Tab(2).Control(10)= "cmdInventory" Tab(2).Control(10).Enabled= 0 'False Tab(2).Control(11)= "txtLMBalance" Tab(2).Control(11).Enabled= 0 'False Tab(2).Control(12)= "cboLMMetal" Tab(2).Control(12).Enabled= 0 'False Tab(2).Control(13)= "cboLMType" Tab(2).Control(13).Enabled= 0 'False Tab(2).Control(14)= "cboLMDFlag" Tab(2).Control(14).Enabled= 0 'False Tab(2).Control(15)= "txtLMLength" Tab(2).Control(15).Enabled= 0 'False Tab(2).Control(16)= "txtLMQty" Tab(2).Control(16).Enabled= 0 'False Tab(2).Control(17)= "txtLMInvNo" Tab(2).Control(17).Enabled= 0 'False Tab(2).Control(18)= "txtLMDesc" Tab(2).Control(18).Enabled= 0 'False Tab(2).Control(19)= "cmdDelMatrl" Tab(2).Control(19).Enabled= 0 'False Tab(2).Control(20)= "cmdSaveMatrl" Tab(2).Control(20).Enabled= 0 'False Tab(2).Control(21)= "cmdAddMatrl" Tab(2).Control(21).Enabled= 0 'False Tab(2).Control(22)= "lstLMaterial" Tab(2).Control(22).Enabled= 0 'False Tab(2).Control(23)= "lstInventory" Tab(2).Control(23).Enabled= 0 'False Tab(2).ControlCount= 24 TabCaption(3) = "Op&tions" TabPicture(3) = "frmLotInfo.frx":0496 Tab(3).ControlEnabled= 0 'False Tab(3).Control(0)= "lstOptMatrl" Tab(3).Control(0).Enabled= 0 'False Tab(3).Control(1)= "txtOSt_SqFt" Tab(3).Control(1).Enabled= 0 'False Tab(3).Control(2)= "chkOStone" Tab(3).Control(2).Enabled= 0 'False Tab(3).Control(3)= "lstPOptions" Tab(3).Control(3).Enabled= 0 'False Tab(3).Control(4)= "cmdOptAdd" Tab(3).Control(4).Enabled= 0 'False Tab(3).Control(5)= "cmdOptDel" Tab(3).Control(5).Enabled= 0 'False Tab(3).Control(6)= "lstLOptions" Tab(3).Control(6).Enabled= 0 'False Tab(3).Control(7)= "txtLODesc" Tab(3).Control(7).Enabled= 0 'False Tab(3).Control(8)= "txtLOYdge" Tab(3).Control(8).Enabled= 0 'False Tab(3).Control(9)= "txtLOFin2" Tab(3).Control(9).Enabled= 0 'False Tab(3).Control(10)= "txtLOFoam" Tab(3).Control(10).Enabled= 0 'False Tab(3).Control(11)= "txtLOTexture" Tab(3).Control(11).Enabled= 0 'False Tab(3).Control(12)= "txtLOMDesc" Tab(3).Control(12).Enabled= 0 'False Tab(3).Control(13)= "txtLOMInvNo" Tab(3).Control(13).Enabled= 0 'False Tab(3).Control(14)= "txtLOMQty" Tab(3).Control(14).Enabled= 0 'False Tab(3).Control(15)= "txtLOMLength" Tab(3).Control(15).Enabled= 0 'False Tab(3).Control(16)= "cboLOMDFlag" Tab(3).Control(16).Enabled= 0 'False Tab(3).Control(17)= "cboLOMType" Tab(3).Control(17).Enabled= 0 'False Tab(3).Control(18)= "cboLOMetal" Tab(3).Control(18).Enabled= 0 'False Tab(3).Control(19)= "txtNote2" Tab(3).Control(19).Enabled= 0 'False Tab(3).Control(20)= "txtNote" Tab(3).Control(20).Enabled= 0 'False Tab(3).Control(21)= "lblOptNum" Tab(3).Control(21).Enabled= 0 'False Tab(3).Control(22)= "lblOStone" Tab(3).Control(22).Enabled= 0 'False Tab(3).Control(23)= "lblPOptions" Tab(3).Control(23).Enabled= 0 'False Tab(3).Control(24)= "lblLOptions" Tab(3).Control(24).Enabled= 0 'False Tab(3).Control(25)= "lblLODesc" Tab(3).Control(25).Enabled= 0 'False Tab(3).Control(26)= "lblLOYdge" Tab(3).Control(26).Enabled= 0 'False Tab(3).Control(27)= "lblLOFin2" Tab(3).Control(27).Enabled= 0 'False Tab(3).Control(28)= "lblLOFAdj" Tab(3).Control(28).Enabled= 0 'False Tab(3).Control(29)= "lblLOTexture" Tab(3).Control(29).Enabled= 0 'False Tab(3).Control(30)= "lblLOMDesc" Tab(3).Control(30).Enabled= 0 'False Tab(3).Control(31)= "lblLOMInvNo" Tab(3).Control(31).Enabled= 0 'False Tab(3).Control(32)= "lblLOMQty" Tab(3).Control(32).Enabled= 0 'False Tab(3).Control(33)= "lblLOMDFlag" Tab(3).Control(33).Enabled= 0 'False Tab(3).Control(34)= "lblLOMType" Tab(3).Control(34).Enabled= 0 'False Tab(3).Control(35)= "lblLOMetal" Tab(3).Control(35).Enabled= 0 'False Tab(3).Control(36)= "lblLOMLength" Tab(3).Control(36).Enabled= 0 'False Tab(3).Control(37)= "lblSelectOpt" Tab(3).Control(37).Enabled= 0 'False Tab(3).Control(38)= "lblBillingAmt" Tab(3).Control(38).Enabled= 0 'False Tab(3).Control(39)= "lblBAmt" Tab(3).Control(39).Enabled= 0 'False Tab(3).ControlCount= 40 TabCaption(4) = "&Lath Orders" TabPicture(4) = "frmLotInfo.frx":04B2 Tab(4).ControlEnabled= 0 'False Tab(4).Control(0)= "lstYard" Tab(4).Control(0).Enabled= 0 'False Tab(4).Control(1)= "lstLath" Tab(4).Control(1).Enabled= 0 'False Tab(4).Control(2)= "lblYardOrd" Tab(4).Control(3)= "lblLathOrd" Tab(4).ControlCount= 4 TabCaption(5) = "Stucco &Orders" TabPicture(5) = "frmLotInfo.frx":04CE Tab(5).ControlEnabled= 0 'False Tab(5).Control(0)= "lstScratch" Tab(5).Control(0).Enabled= 0 'False Tab(5).Control(1)= "lstBrown" Tab(5).Control(1).Enabled= 0 'False Tab(5).Control(2)= "lstTexture" Tab(5).Control(2).Enabled= 0 'False Tab(5).Control(3)= "lblScrOrd" Tab(5).Control(4)= "lblBrnOrd" Tab(5).Control(5)= "lblTexOrd" Tab(5).ControlCount= 6 TabCaption(6) = "&Purchase Orders" TabPicture(6) = "frmLotInfo.frx":04EA Tab(6).ControlEnabled= 0 'False Tab(6).Control(0)= "lblPayYds" Tab(6).Control(0).Enabled= 0 'False Tab(6).Control(1)= "lblOptMatPrice" Tab(6).Control(1).Enabled= 0 'False Tab(6).Control(2)= "lblPODate" Tab(6).Control(2).Enabled= 0 'False Tab(6).Control(3)= "lblPOMType" Tab(6).Control(3).Enabled= 0 'False Tab(6).Control(4)= "lblPODFlag" Tab(6).Control(4).Enabled= 0 'False Tab(6).Control(5)= "lblPOQty" Tab(6).Control(5).Enabled= 0 'False Tab(6).Control(6)= "lblDescription" Tab(6).Control(6).Enabled= 0 'False Tab(6).Control(7)= "lblInvNo" Tab(6).Control(7).Enabled= 0 'False Tab(6).Control(8)= "lblPONum" Tab(6).Control(8).Enabled= 0 'False Tab(6).Control(9)= "lblDesc" Tab(6).Control(9).Enabled= 0 'False Tab(6).Control(10)= "lblPO" Tab(6).Control(10).Enabled= 0 'False Tab(6).Control(11)= "lblPONotes" Tab(6).Control(11).Enabled= 0 'False Tab(6).Control(12)= "lblPOMaterials" Tab(6).Control(12).Enabled= 0 'False Tab(6).Control(13)= "lblIssueTo" Tab(6).Control(13).Enabled= 0 'False Tab(6).Control(14)= "lblPOType" Tab(6).Control(14).Enabled= 0 'False Tab(6).Control(15)= "lblPayType" Tab(6).Control(15).Enabled= 0 'False Tab(6).Control(16)= "cmdPrintPOPay" Tab(6).Control(16).Enabled= 0 'False Tab(6).Control(17)= "txtPay" Tab(6).Control(17).Enabled= 0 'False Tab(6).Control(18)= "fraPO" Tab(6).Control(18).Enabled= 0 'False Tab(6).Control(19)= "cmdPrintForm" Tab(6).Control(19).Enabled= 0 'False Tab(6).Control(20)= "txtPOPrice" Tab(6).Control(20).Enabled= 0 'False Tab(6).Control(21)= "txtPODate" Tab(6).Control(21).Enabled= 0 'False Tab(6).Control(22)= "txtPODesc" Tab(6).Control(22).Enabled= 0 'False Tab(6).Control(23)= "txtPOMatDesc" Tab(6).Control(23).Enabled= 0 'False Tab(6).Control(24)= "cmdPrintPO" Tab(6).Control(24).Enabled= 0 'False Tab(6).Control(25)= "cmdDelPOMat" Tab(6).Control(25).Enabled= 0 'False Tab(6).Control(26)= "cmdSavePOMat" Tab(6).Control(26).Enabled= 0 'False Tab(6).Control(27)= "cmdAddPOMat" Tab(6).Control(27).Enabled= 0 'False Tab(6).Control(28)= "cmdFindPOMat" Tab(6).Control(28).Enabled= 0 'False Tab(6).Control(29)= "cboPOMType" Tab(6).Control(29).Enabled= 0 'False Tab(6).Control(30)= "cboPODFlag" Tab(6).Control(30).Enabled= 0 'False Tab(6).Control(31)= "txtPOQty" Tab(6).Control(31).Enabled= 0 'False Tab(6).Control(32)= "txtPOInvNo" Tab(6).Control(32).Enabled= 0 'False Tab(6).Control(33)= "cmdDelPO" Tab(6).Control(33).Enabled= 0 'False Tab(6).Control(34)= "cmdSavePO" Tab(6).Control(34).Enabled= 0 'False Tab(6).Control(35)= "cmdAddPO" Tab(6).Control(35).Enabled= 0 'False Tab(6).Control(36)= "txtIssueTo" Tab(6).Control(36).Enabled= 0 'False Tab(6).Control(37)= "txtPONum" Tab(6).Control(37).Enabled= 0 'False Tab(6).Control(38)= "txtPONotes" Tab(6).Control(38).Enabled= 0 'False Tab(6).Control(39)= "lstPO" Tab(6).Control(39).Enabled= 0 'False Tab(6).Control(40)= "cboPOType" Tab(6).Control(40).Enabled= 0 'False Tab(6).Control(41)= "txtPOType" Tab(6).Control(41).Enabled= 0 'False Tab(6).Control(42)= "txtPayType" Tab(6).Control(42).Enabled= 0 'False Tab(6).Control(43)= "lstPOMaterial" Tab(6).Control(43).Enabled= 0 'False Tab(6).Control(44)= "lstLOOKUP" Tab(6).Control(44).Enabled= 0 'False Tab(6).ControlCount= 45 Begin LpLib.fpList lstInventory Height = 2250 Left = -66750 TabIndex = 248 Top = 2730 Visible = 0 'False Width = 3075 _Version = 196608 _ExtentX = 5424 _ExtentY = 3969 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 = 2 Sorted = 1 LineWidth = 1 SelDrawFocusRect= -1 'True ColumnSeparatorChar= 9 ColumnSearch = 0 ColumnWidthScale= 2 RowHeight = -1 MultiSelect = 0 WrapList = 0 'False WrapWidth = 0 SelMax = -1 AutoSearch = 2 SearchMethod = 1 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= 210 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmLotInfo.frx":0506 End Begin LpLib.fpList lstLOOKUP Height = 2805 Left = -67200 TabIndex = 247 Top = 2640 Visible = 0 'False Width = 3555 _Version = 196608 _ExtentX = 6271 _ExtentY = 4948 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 = 2 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= 210 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmLotInfo.frx":0827 End Begin LpLib.fpList lstPOMaterial Height = 1260 Left = -73770 TabIndex = 246 Top = 4245 Width = 3915 _Version = 196608 _ExtentX = 6906 _ExtentY = 2222 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 = 5 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 = "frmLotInfo.frx":0B3F End Begin LpLib.fpList lstOptMatrl Height = 840 Left = -74760 TabIndex = 245 Top = 4650 Width = 5475 _Version = 196608 _ExtentX = 9657 _ExtentY = 1482 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 = "frmLotInfo.frx":0F35 End Begin LpLib.fpList lstLMaterial Height = 4560 Left = -74925 TabIndex = 244 Top = 900 Width = 5655 _Version = 196608 _ExtentX = 9975 _ExtentY = 8043 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 = 0 ColumnWidthScale= 2 RowHeight = -1 MultiSelect = 0 WrapList = 0 'False WrapWidth = 0 SelMax = -1 AutoSearch = 1 SearchMethod = 1 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= 210 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmLotInfo.frx":1361 End Begin VB.CheckBox chkPaint Alignment = 1 'Right Justify Caption = "Paint" Height = 255 Left = 540 TabIndex = 238 Top = 3345 Width = 1155 End Begin VB.CommandButton cmdPreOrderPrintPC Caption = "Print PreCast PreOrders" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -66540 TabIndex = 236 Top = 1380 Width = 1335 End Begin VB.CommandButton cmdIssue Caption = "RePrint &Yard Ticket" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -69420 TabIndex = 233 Top = 1380 Visible = 0 'False Width = 1335 End Begin VB.CheckBox chkNoPay Alignment = 1 'Right Justify BackColor = &H00C0C0C0& Caption = "No Pay Sheets Issued" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 2220 TabIndex = 232 Top = 3420 Width = 2295 End Begin VB.CheckBox chkOthers Alignment = 1 'Right Justify Caption = "Stone by Others" Height = 255 Left = 2940 TabIndex = 231 Top = 3180 Width = 1575 End Begin VB.CommandButton cmdPrint Caption = "All Orders Printed" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 3015 TabIndex = 230 Top = 1500 Width = 1215 End Begin VB.TextBox txtOSt_SqFt Alignment = 1 'Right Justify Height = 300 Left = -64755 TabIndex = 229 Top = 675 Width = 975 End Begin VB.CheckBox chkOStone Alignment = 1 'Right Justify Caption = "Stone Veneer Option:" Height = 240 Left = -68475 TabIndex = 227 Top = 735 Width = 1890 End Begin VB.CheckBox chkStone Alignment = 1 'Right Justify Caption = "Stone Veneer" Height = 255 Left = 3180 TabIndex = 224 Top = 2925 Width = 1335 End Begin VB.TextBox txtPayType Height = 315 Left = -71895 MaxLength = 1 TabIndex = 55 Top = 2295 Width = 375 End Begin VB.CommandButton cmdOrder 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 = 615 Left = 5520 TabIndex = 219 Top = 2160 Width = 1215 End Begin VB.TextBox txtPOType Height = 285 Left = -70980 TabIndex = 218 TabStop = 0 'False Top = 840 Visible = 0 'False Width = 615 End Begin VB.ComboBox cboPOType Height = 315 ItemData = "frmLotInfo.frx":1783 Left = -72300 List = "frmLotInfo.frx":1793 Style = 2 'Dropdown List TabIndex = 52 Top = 1200 Width = 1995 End Begin VB.CheckBox chkSynthetic Alignment = 1 'Right Justify Caption = "Synthetic" Height = 195 Left = 2100 TabIndex = 214 Top = 2940 Width = 975 End Begin VB.CommandButton cmdLFlag Caption = "Set Lath Flags" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -69420 TabIndex = 213 Top = 720 Visible = 0 'False Width = 1335 End Begin VB.CheckBox chkHoldPO Alignment = 1 'Right Justify Caption = "Hold PO's" Height = 255 Left = 540 TabIndex = 210 Top = 3120 Width = 1155 End Begin VB.CheckBox chkHoldOrders Alignment = 1 'Right Justify Caption = "Hold Orders" ForeColor = &H00404040& Height = 255 Left = 540 MaskColor = &H000000FF& TabIndex = 209 Top = 2880 Width = 1155 End Begin VB.CommandButton cmdJCSetup Caption = "Setup JC Record" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 5520 TabIndex = 208 Top = 1500 Width = 1215 End Begin VB.TextBox txtTake138 Alignment = 1 'Right Justify Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 360 Left = -73080 TabIndex = 134 TabStop = 0 'False Top = 1680 Width = 795 End Begin VB.TextBox txtSuperBB Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -73080 MaxLength = 4 TabIndex = 124 Top = 2340 Width = 795 End Begin VB.TextBox txtSuper12 Alignment = 1 'Right Justify Height = 315 Left = -73065 MaxLength = 4 TabIndex = 125 Top = 2940 Width = 795 End Begin VB.TextBox txtSuper783 Alignment = 1 'Right Justify Height = 315 Left = -73080 MaxLength = 4 TabIndex = 126 Top = 3540 Width = 795 End Begin VB.TextBox txtSuper78 Alignment = 1 'Right Justify Height = 315 Left = -73080 MaxLength = 4 TabIndex = 127 Top = 4155 Width = 795 End Begin VB.TextBox txtSuper38 Alignment = 1 'Right Justify Height = 315 Left = -73080 MaxLength = 4 TabIndex = 128 Top = 4740 Width = 795 End Begin VB.TextBox txtSuper1383 Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -70620 MaxLength = 4 TabIndex = 129 Top = 2340 Width = 795 End Begin VB.TextBox txtSuperRL Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -70620 MaxLength = 4 TabIndex = 130 Top = 2940 Width = 795 End Begin VB.TextBox txtSuperML Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -70620 MaxLength = 4 TabIndex = 131 Top = 3540 Width = 795 End Begin VB.TextBox txtSuperDW Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -70620 MaxLength = 4 TabIndex = 132 Top = 4140 Width = 795 End Begin VB.TextBox txtSuperSP Alignment = 1 'Right Justify Height = 315 Left = -70620 MaxLength = 4 TabIndex = 133 Top = 4740 Width = 795 End Begin VB.ListBox lstPOptions Height = 2010 ItemData = "frmLotInfo.frx":17CE Left = -74760 List = "frmLotInfo.frx":17D5 TabIndex = 123 Top = 1020 Width = 3095 End Begin VB.ListBox lstYard Height = 4155 Left = -74820 TabIndex = 122 TabStop = 0 'False Top = 1140 Width = 5445 End Begin VB.ListBox lstLath Height = 4155 Left = -69180 TabIndex = 121 TabStop = 0 'False Top = 1140 Width = 5445 End Begin VB.ListBox lstScratch Height = 4350 Left = -74880 TabIndex = 120 TabStop = 0 'False Top = 1140 Width = 3660 End Begin VB.ListBox lstBrown Height = 4350 Left = -71100 TabIndex = 119 TabStop = 0 'False Top = 1140 Width = 3660 End Begin VB.ListBox lstTexture Height = 4350 Left = -67320 TabIndex = 118 TabStop = 0 'False Top = 1140 Width = 3660 End Begin VB.ListBox lstPO Height = 4350 Left = -74760 Sorted = -1 'True TabIndex = 117 Top = 1080 Width = 885 End Begin VB.TextBox txtPONotes Height = 1215 Left = -73800 MaxLength = 250 MultiLine = -1 'True TabIndex = 57 Top = 2700 Width = 3915 End Begin VB.TextBox txtPONum BackColor = &H00E0E0E0& Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = -72300 TabIndex = 116 TabStop = 0 'False Top = 840 Width = 975 End Begin VB.TextBox txtIssueTo Height = 315 Left = -72300 MaxLength = 50 TabIndex = 53 Top = 1560 Width = 3735 End Begin VB.CommandButton cmdAddPO Caption = "&New PO" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -68400 TabIndex = 115 TabStop = 0 'False Top = 960 Width = 1035 End Begin VB.CommandButton cmdSavePO Caption = "S&ave PO" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -67260 TabIndex = 59 Top = 960 Width = 1035 End Begin VB.CommandButton cmdDelPO Caption = "D&elete PO" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -66120 TabIndex = 114 TabStop = 0 'False Top = 960 Width = 1035 End Begin VB.CommandButton cmdOptAdd Caption = "Add Option" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -66240 TabIndex = 113 TabStop = 0 'False Top = 1380 Width = 1275 End Begin VB.CommandButton cmdOptDel Caption = "Delete Option" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -64920 TabIndex = 112 TabStop = 0 'False Top = 1380 Width = 1275 End Begin VB.CommandButton cmdAddMatrl Caption = "Add Materials" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -69120 TabIndex = 111 TabStop = 0 'False Top = 5040 Width = 1335 End Begin VB.CommandButton cmdSaveMatrl Caption = "Save Materials" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -67080 TabIndex = 109 Top = 5040 Width = 1335 End Begin VB.CommandButton cmdDelMatrl Caption = "Delete Materials" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -65040 TabIndex = 110 TabStop = 0 'False Top = 5040 Width = 1335 End Begin VB.ListBox lstPreOrder Height = 1620 Left = -69240 TabIndex = 108 TabStop = 0 'False Top = 2160 Width = 5445 End Begin VB.TextBox txtLMDesc Height = 315 Left = -68100 MaxLength = 50 TabIndex = 99 Top = 780 Width = 4275 End Begin VB.TextBox txtLMInvNo Height = 315 Left = -68100 MaxLength = 18 TabIndex = 100 Top = 1200 Width = 2625 End Begin VB.TextBox txtLMQty Alignment = 1 'Right Justify Height = 315 Left = -68100 MaxLength = 4 TabIndex = 101 Top = 1560 Width = 915 End Begin VB.TextBox txtLMLength Alignment = 1 'Right Justify Height = 315 Left = -68100 MaxLength = 2 TabIndex = 105 Top = 3192 Width = 915 End Begin VB.ComboBox cboLMDFlag Height = 315 ItemData = "frmLotInfo.frx":17E6 Left = -68100 List = "frmLotInfo.frx":17F0 Style = 2 'Dropdown List TabIndex = 102 Top = 1980 Width = 1215 End Begin VB.ComboBox cboLMType Height = 315 ItemData = "frmLotInfo.frx":1804 Left = -68100 List = "frmLotInfo.frx":1806 Style = 2 'Dropdown List TabIndex = 103 Top = 2400 Width = 1215 End Begin VB.ComboBox cboLMMetal Height = 315 ItemData = "frmLotInfo.frx":1808 Left = -68100 List = "frmLotInfo.frx":1812 Style = 2 'Dropdown List TabIndex = 104 Top = 2790 Width = 1215 End Begin VB.TextBox txtLMBalance Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -68100 TabIndex = 106 TabStop = 0 'False Top = 3600 Width = 915 End Begin VB.ListBox lstLOptions Height = 2010 Left = -71640 TabIndex = 98 Top = 1020 Width = 3095 End Begin VB.TextBox txtLODesc Enabled = 0 'False Height = 315 Left = -67200 TabIndex = 93 TabStop = 0 'False Top = 1020 Width = 2835 End Begin VB.TextBox txtLOYdge Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -67200 TabIndex = 97 TabStop = 0 'False Top = 1440 Width = 915 End Begin VB.TextBox txtLOFin2 Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -67200 TabIndex = 96 TabStop = 0 'False Top = 1860 Width = 915 End Begin VB.TextBox txtLOFoam Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -67200 TabIndex = 95 TabStop = 0 'False Top = 2280 Width = 915 End Begin VB.TextBox txtLOTexture Enabled = 0 'False Height = 315 Left = -67200 TabIndex = 94 TabStop = 0 'False Top = 2700 Width = 1755 End Begin VB.TextBox txtLOMDesc Enabled = 0 'False Height = 315 Left = -68100 TabIndex = 92 TabStop = 0 'False Top = 3135 Width = 4155 End Begin VB.TextBox txtLOMInvNo Enabled = 0 'False Height = 315 Left = -68100 MaxLength = 18 TabIndex = 91 TabStop = 0 'False Top = 3480 Width = 2625 End Begin VB.TextBox txtLOMQty Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -68100 TabIndex = 90 TabStop = 0 'False Top = 3810 Width = 915 End Begin VB.TextBox txtLOMLength Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = -68100 TabIndex = 89 TabStop = 0 'False Top = 5160 Width = 915 End Begin VB.ComboBox cboLOMDFlag Enabled = 0 'False Height = 315 Left = -68100 TabIndex = 88 TabStop = 0 'False Text = "cboLOMDFlag" Top = 4155 Width = 1155 End Begin VB.ComboBox cboLOMType Enabled = 0 'False Height = 315 ItemData = "frmLotInfo.frx":1823 Left = -68100 List = "frmLotInfo.frx":1825 TabIndex = 87 TabStop = 0 'False Text = "cboLOMType" Top = 4500 Width = 1155 End Begin VB.ComboBox cboLOMetal Enabled = 0 'False Height = 315 Left = -68100 TabIndex = 86 TabStop = 0 'False Text = "cboLOMetal" Top = 4830 Width = 1155 End Begin VB.CommandButton cmdCalc Caption = "Calculate Materials" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 480 TabIndex = 85 TabStop = 0 'False Top = 840 Width = 1215 End Begin VB.CommandButton cmdExit Caption = "E&xit" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 480 TabIndex = 84 TabStop = 0 'False Top = 2160 Width = 1215 End Begin VB.CommandButton cmdOrders Caption = "Setup 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 = 615 Left = 480 TabIndex = 83 TabStop = 0 'False Top = 1500 Width = 1215 End Begin VB.CommandButton cmdSaveLotInfo Caption = "Save Lot Information" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 1740 TabIndex = 82 TabStop = 0 'False Top = 1500 Width = 1215 End Begin VB.CommandButton cmdInventory Caption = "Inventory 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 = 495 Left = -69120 TabIndex = 81 TabStop = 0 'False Top = 4440 Visible = 0 'False Width = 1335 End Begin VB.TextBox txtLathO Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 TabIndex = 80 TabStop = 0 'False Top = 1080 Width = 1335 End Begin VB.TextBox txtSandO Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 TabIndex = 79 TabStop = 0 'False Top = 1422 Width = 1335 End Begin VB.TextBox txtScratchO Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 TabIndex = 78 TabStop = 0 'False Top = 1764 Width = 1335 End Begin VB.TextBox txtBrownO Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 TabIndex = 77 TabStop = 0 'False Top = 2106 Width = 1335 End Begin VB.TextBox txtTextureO Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 TabIndex = 76 TabStop = 0 'False Top = 2448 Width = 1335 End Begin VB.TextBox txtLathBill Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 MaxLength = 10 TabIndex = 75 TabStop = 0 'False Top = 2790 Width = 1335 End Begin VB.CommandButton cmdAddLot Caption = "Add New Lot" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 1740 TabIndex = 74 TabStop = 0 'False Top = 840 Width = 1215 End Begin VB.CommandButton cmdDelLot Caption = "Delete Lot Information" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 1740 TabIndex = 73 TabStop = 0 'False Top = 2160 Width = 1215 End Begin VB.TextBox txtCalc138 Appearance = 0 'Flat BackColor = &H80000000& BorderStyle = 0 'None Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = -69720 TabIndex = 72 TabStop = 0 'False Top = 2400 Width = 435 End Begin VB.CheckBox chkChange Alignment = 1 'Right Justify Caption = "Recalc Flag:" Height = 255 Left = -69180 TabIndex = 107 Top = 4020 Width = 1455 End Begin VB.TextBox txtMetal Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 9900 TabIndex = 71 Top = 3480 Width = 1335 End Begin VB.TextBox txtPOInvNo Height = 315 Left = -68760 MaxLength = 18 TabIndex = 63 Top = 2625 Width = 2625 End Begin VB.TextBox txtPOQty Alignment = 1 'Right Justify Height = 315 Left = -68760 MaxLength = 4 TabIndex = 66 Top = 3360 Width = 915 End Begin VB.ComboBox cboPODFlag Height = 315 ItemData = "frmLotInfo.frx":1827 Left = -68760 List = "frmLotInfo.frx":1831 Style = 2 'Dropdown List TabIndex = 67 Top = 3720 Width = 1215 End Begin VB.ComboBox cboPOMType Height = 315 ItemData = "frmLotInfo.frx":1845 Left = -68760 List = "frmLotInfo.frx":1847 Style = 2 'Dropdown List TabIndex = 68 Top = 4080 Width = 1215 End Begin VB.CommandButton cmdFindPOMat Height = 435 Left = -66090 Picture = "frmLotInfo.frx":1849 Style = 1 'Graphical TabIndex = 64 Top = 2535 Visible = 0 'False Width = 435 End Begin VB.CommandButton cmdAddPOMat Caption = "&Add Material" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -68400 TabIndex = 62 TabStop = 0 'False Top = 1560 Width = 1035 End Begin VB.CommandButton cmdSavePOMat Caption = "S&ave Material" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -67260 TabIndex = 70 Top = 1560 Width = 1035 End Begin VB.CommandButton cmdDelPOMat Caption = "D&elete Material" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -66120 TabIndex = 61 TabStop = 0 'False Top = 1560 Width = 1035 End Begin VB.CommandButton cmdPrintPO Caption = "P&rint PO" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -64980 TabIndex = 60 TabStop = 0 'False Top = 960 Width = 1095 End Begin VB.TextBox txtPOMatDesc Height = 315 Left = -68760 MaxLength = 50 TabIndex = 65 Top = 3000 Width = 4275 End Begin VB.TextBox txtPODesc Height = 315 Left = -72300 MaxLength = 50 TabIndex = 54 Top = 1920 Width = 3735 End Begin VB.TextBox txtPODate Alignment = 1 'Right Justify Height = 315 Left = -69600 MaxLength = 10 TabIndex = 58 Top = 1200 Width = 1035 End Begin VB.TextBox txtPOPrice Alignment = 1 'Right Justify Height = 315 Left = -68760 TabIndex = 69 Top = 4440 Width = 975 End Begin VB.CommandButton cmdPrintForm Caption = "Print Form" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -64980 TabIndex = 51 TabStop = 0 'False Top = 1560 Width = 1095 End Begin VB.CommandButton cmdSuperRpt Caption = "Print Super's Report" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 3000 TabIndex = 50 TabStop = 0 'False Top = 840 Width = 1215 End Begin VB.CommandButton cmdPreOrderPrintY Caption = "Print Yard PreOrders" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -65100 TabIndex = 49 TabStop = 0 'False Top = 720 Width = 1335 End Begin VB.CommandButton cmdPreOrderPrintS Caption = "Print Supplier PreOrders" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -65100 TabIndex = 48 TabStop = 0 'False Top = 1380 Width = 1335 End Begin VB.Frame fraPO Height = 390 Left = -68475 TabIndex = 43 Top = 2100 Width = 4830 Begin VB.OptionButton optStone Caption = "Stone" Height = 255 Left = 3240 TabIndex = 235 Top = 120 Width = 795 End Begin VB.OptionButton optPreOrder Caption = "PreOrder" Height = 255 Left = 2280 TabIndex = 222 Top = 120 Width = 975 End Begin VB.OptionButton optLath Caption = "Lath" Height = 255 Left = 60 TabIndex = 47 Top = 120 Width = 675 End Begin VB.OptionButton optStucco Caption = "Stucco" Height = 255 Left = 720 TabIndex = 46 Top = 120 Width = 855 End Begin VB.OptionButton optSand Caption = "Sand" Height = 255 Left = 1560 TabIndex = 45 Top = 120 Width = 735 End Begin VB.OptionButton optNone Caption = "None" Height = 255 Left = 3990 TabIndex = 44 Top = 120 Value = -1 'True Width = 735 End End Begin VB.TextBox txtSuperNotes Height = 1275 Left = -69240 MaxLength = 255 MultiLine = -1 'True TabIndex = 144 Top = 4200 Width = 5445 End Begin VB.CommandButton cmdEdit Caption = "Edit Lot Information" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 4260 TabIndex = 42 TabStop = 0 'False Top = 2160 Visible = 0 'False Width = 1215 End Begin VB.TextBox txtYardMemo Height = 1575 Left = 480 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 41 Top = 3900 Width = 5355 End Begin VB.CommandButton cmdUpCMU Caption = "Update CMU Yardage" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 4260 TabIndex = 40 TabStop = 0 'False Top = 840 Width = 1215 End Begin VB.CommandButton cmdPrintCMU Caption = "Print CMU Pay Sheet" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 4260 TabIndex = 39 TabStop = 0 'False Top = 1500 Width = 1215 End Begin VB.TextBox txtPay Alignment = 1 'Right Justify Height = 315 Left = -70215 TabIndex = 56 Top = 2295 Width = 675 End Begin VB.CommandButton cmdPrintPOPay Caption = "Print Pay Sheet" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -68760 TabIndex = 38 Top = 4785 Width = 1035 End Begin VB.CommandButton cmdLathPay Caption = "RePrint Lath Pay" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -66540 TabIndex = 37 Top = 720 Visible = 0 'False Width = 1335 End Begin VB.CommandButton cmdStuccoPay Caption = "RePrint Stucco Pay" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = -67980 TabIndex = 36 Top = 1380 Visible = 0 'False Width = 1335 End Begin VB.CommandButton cmdRePrintL Caption = "ReSet Lath Print" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -67980 TabIndex = 35 Top = 720 Visible = 0 'False Width = 1335 End Begin VB.CommandButton cmdShowChange Caption = "Show Change Log" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 5520 TabIndex = 34 TabStop = 0 'False Top = 840 Width = 1215 End Begin VB.TextBox txtNote2 Enabled = 0 'False Height = 795 Left = -74760 MultiLine = -1 'True TabIndex = 33 Top = 3060 Width = 5475 End Begin VB.TextBox txtNote Enabled = 0 'False Height = 795 Left = -74760 MultiLine = -1 'True TabIndex = 32 Top = 3855 Width = 5475 End Begin VB.TextBox txtLotNotes Height = 1575 Left = 5880 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 31 Top = 3900 Width = 5355 End Begin VB.Label lblOptNum 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 = -70500 TabIndex = 237 Top = 720 Width = 1680 End Begin VB.Label lblZMetal Alignment = 2 'Center Caption = "This House Uses Z-Metal" BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 375 Left = -74940 TabIndex = 234 Top = 5160 Visible = 0 'False Width = 5655 End Begin VB.Label lblOStone Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Stone Veneer Opt. SqFt:" Height = 195 Left = -66540 TabIndex = 228 Top = 750 Width = 1740 End Begin VB.Label lblPayType Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Pay Type:" Height = 195 Left = -72690 TabIndex = 223 Top = 2370 Width = 720 End Begin VB.Label lblPOType Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "PO Type:" Height = 195 Left = -73005 TabIndex = 217 Top = 1260 Width = 675 End Begin VB.Label lblBB Alignment = 2 'Center Caption = "This House Uses R-Guard" BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 675 Left = -72180 TabIndex = 216 Top = 1380 Width = 2475 End Begin VB.Label lblTake138 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Takeoff 1 3/8 J-Metal:" Height = 195 Left = -74895 TabIndex = 204 Top = 1740 Width = 1590 End Begin VB.Label lblSuperBB Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Blackboard/R-Guard:" Height = 195 Left = -74835 TabIndex = 203 Top = 2400 Width = 1530 End Begin VB.Line linSO BorderWidth = 2 X1 = -75000 X2 = -69660 Y1 = 2160 Y2 = 2160 End Begin VB.Label lblSuper12 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "1/2 Foam:" Height = 195 Left = -74040 TabIndex = 202 Top = 3000 Width = 735 End Begin VB.Label lblSuper783 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "7/8X3 JMB:" Height = 195 Left = -74160 TabIndex = 201 Top = 3600 Width = 855 End Begin VB.Label lblSuper78 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "7/8 JMB:" Height = 195 Left = -73965 TabIndex = 200 Top = 4200 Width = 660 End Begin VB.Label lblSuper38 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "3/8 JMB:" Height = 195 Left = -73965 TabIndex = 199 Top = 4800 Width = 660 End Begin VB.Label lblSuper138 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "1 3/8 X 3 JMB:" Height = 195 Left = -71880 TabIndex = 198 Top = 2400 Width = 1080 End Begin VB.Label lblSuperML Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Metal Lath:" Enabled = 0 'False Height = 195 Left = -71580 TabIndex = 197 Top = 3600 Width = 795 End Begin VB.Label lblSuperRL Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Rib Lath:" Enabled = 0 'False Height = 195 Left = -71460 TabIndex = 196 Top = 3000 Width = 645 End Begin VB.Label lblSuperDW Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Drywall:" Enabled = 0 'False Height = 195 Left = -71340 TabIndex = 195 Top = 4200 Width = 555 End Begin VB.Label lblSuperSP Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Sheer Panel:" Height = 195 Left = -71700 TabIndex = 194 Top = 4800 Width = 915 End Begin VB.Label lblIssueTo Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Invoice Description:" Height = 195 Left = -73740 TabIndex = 193 Top = 1620 Width = 1410 End Begin VB.Label lblPOMaterials AutoSize = -1 'True Caption = "P.O. Materials:" 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 = -73800 TabIndex = 192 Top = 4020 Width = 1275 End Begin VB.Label lblPONotes Caption = "P.O. Notes:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = -73800 TabIndex = 191 Top = 2460 Width = 1575 End Begin VB.Label lblPO Caption = "Purchase Orders" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = -74760 TabIndex = 190 Top = 720 Width = 1815 End Begin VB.Label lblScrOrd AutoSize = -1 'True Caption = "Scratch Order" 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 = -74820 TabIndex = 189 Top = 840 Width = 1200 End Begin VB.Label lblBrnOrd AutoSize = -1 'True Caption = "Brown Order" 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 = -71040 TabIndex = 188 Top = 840 Width = 1065 End Begin VB.Label lblTexOrd AutoSize = -1 'True Caption = "Texture Order" 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 = -67260 TabIndex = 187 Top = 840 Width = 1185 End Begin VB.Label lblYardOrd AutoSize = -1 'True Caption = "Yard Order" 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 = -74700 TabIndex = 186 Top = 900 Width = 930 End Begin VB.Label lblLathOrd AutoSize = -1 'True Caption = "Supplier Lath Order" 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 = -69120 TabIndex = 185 Top = 900 Width = 1665 End Begin VB.Label lblSupHelp Caption = $"frmLotInfo.frx":1C8B Height = 750 Left = -74760 TabIndex = 184 Top = 705 Width = 5115 End Begin VB.Label lblPreOrder Alignment = 2 'Center Caption = "Pre Orders" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = -68700 TabIndex = 183 Top = 1905 Width = 2715 End Begin VB.Label lblLMDesc Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Description:" Height = 195 Left = -68955 TabIndex = 182 Top = 840 Width = 840 End Begin VB.Label lblLMInvNo Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Inventory No:" Height = 195 Left = -69075 TabIndex = 181 Top = 1242 Width = 960 End Begin VB.Label lblQty Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Quantity:" Height = 195 Left = -68745 TabIndex = 180 Top = 1644 Width = 630 End Begin VB.Label lblLMDFlag Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Delivery Flag:" Height = 195 Left = -69075 TabIndex = 179 Top = 2046 Width = 960 End Begin VB.Label lblLMType Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Material Type:" Height = 195 Left = -69120 TabIndex = 178 Top = 2448 Width = 1005 End Begin VB.Label lblLMetal Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Metal Flag:" Height = 195 Left = -68895 TabIndex = 177 Top = 2850 Width = 780 End Begin VB.Label lblLMLength Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Metal Length:" Height = 195 Left = -69090 TabIndex = 176 Top = 3252 Width = 975 End Begin VB.Label lblOrderBalance Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Shipped So Far:" Height = 195 Left = -69255 TabIndex = 175 Top = 3645 Width = 1140 End Begin VB.Label lblPOptions AutoSize = -1 'True Caption = "Plan Options" 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 = -74700 TabIndex = 174 Top = 720 Width = 1095 End Begin VB.Label lblLOptions AutoSize = -1 'True Caption = "Lot Options" 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 = -71580 TabIndex = 173 Top = 720 Width = 990 End Begin VB.Label lblLODesc Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Description:" Height = 195 Left = -68100 TabIndex = 172 Top = 1080 Width = 840 End Begin VB.Label lblLOYdge Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Option Yardage:" Height = 195 Left = -68415 TabIndex = 171 Top = 1500 Width = 1155 End Begin VB.Label lblLOFin2 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Finish 2 Ydge:" Height = 195 Left = -68265 TabIndex = 170 Top = 1920 Width = 1005 End Begin VB.Label lblLOFAdj AutoSize = -1 'True Caption = "Option Foam Adj:" Height = 195 Left = -68475 TabIndex = 169 Top = 2340 Width = 1215 End Begin VB.Label lblLOTexture Caption = "Option Texture:" Height = 255 Left = -68415 TabIndex = 168 Top = 2760 Width = 1155 End Begin VB.Label lblLOMDesc Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Description:" Height = 195 Left = -68985 TabIndex = 167 Top = 3135 Width = 840 End Begin VB.Label lblLOMInvNo Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Inventory No:" Height = 195 Left = -69105 TabIndex = 166 Top = 3480 Width = 960 End Begin VB.Label lblLOMQty Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Quanitity:" Height = 195 Left = -68805 TabIndex = 165 Top = 3840 Width = 660 End Begin VB.Label lblLOMDFlag Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Delivery Flag:" Height = 195 Left = -69105 TabIndex = 164 Top = 4185 Width = 960 End Begin VB.Label lblLOMType Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Material Type:" Height = 195 Left = -69150 TabIndex = 163 Top = 4530 Width = 1005 End Begin VB.Label lblLOMetal Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Metal Flag:" Height = 195 Left = -68940 TabIndex = 162 Top = 4890 Width = 780 End Begin VB.Label lblLOMLength Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Metal Length:" Height = 195 Left = -69120 TabIndex = 161 Top = 5220 Width = 975 End Begin VB.Label lblMatInst Caption = $"frmLotInfo.frx":1D77 Height = 1185 Left = -66660 TabIndex = 160 Top = 1545 Visible = 0 'False Width = 2835 End Begin VB.Label lblOrderDates Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Order Dates" 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 = 9900 TabIndex = 159 Top = 780 Width = 1275 End Begin VB.Label lblLathO Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Lath:" Height = 195 Left = 9465 TabIndex = 158 Top = 1140 Width = 360 End Begin VB.Label lblSandO Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Sand:" Height = 195 Left = 9405 TabIndex = 157 Top = 1482 Width = 420 End Begin VB.Label lblScratchO Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Scratch:" Height = 195 Left = 9225 TabIndex = 156 Top = 1824 Width = 600 End Begin VB.Label lblBrownO Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Brown:" Height = 195 Left = 9330 TabIndex = 155 Top = 2166 Width = 495 End Begin VB.Label lblTextureO Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Texture:" Height = 195 Left = 9240 TabIndex = 154 Top = 2508 Width = 585 End Begin VB.Label lblLathBill Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Stone:" Height = 195 Left = 9360 TabIndex = 153 Top = 2850 Width = 465 End Begin VB.Label lblMetal Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Metal Feet:" Height = 195 Left = 9000 TabIndex = 152 Top = 3540 Width = 795 End Begin VB.Label lblSelectOpt Caption = "Double Click the desired option to selected it for Add or Delete." Height = 375 Left = -66060 TabIndex = 151 Top = 2100 Width = 2235 End Begin VB.Label lblDesc Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Pay Description:" Height = 195 Left = -73485 TabIndex = 150 Top = 1980 Width = 1155 End Begin VB.Label lblPONum Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "PO #:" Height = 195 Left = -72750 TabIndex = 149 Top = 900 Width = 420 End Begin VB.Label lblInvNo Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Inv No:" Height = 195 Left = -69360 TabIndex = 148 Top = 2700 Width = 525 End Begin VB.Label lblDescription Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Description:" Height = 195 Left = -69675 TabIndex = 147 Top = 3060 Width = 840 End Begin VB.Label lblPOQty Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Quantity:" Height = 195 Left = -69465 TabIndex = 146 Top = 3420 Width = 630 End Begin VB.Label lblPODFlag Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Delivery Type:" Height = 195 Left = -69795 TabIndex = 145 Top = 3780 Width = 1020 End Begin VB.Label lblPOMType Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Material Type:" Height = 195 Left = -69780 TabIndex = 143 Top = 4140 Width = 1005 End Begin VB.Label lblPODate Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "PO Date:" Height = 195 Left = -70260 TabIndex = 142 Top = 1260 Width = 660 End Begin VB.Label lblBillingAmt Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = -64980 TabIndex = 141 Top = 2700 Width = 915 End Begin VB.Label lblBAmt Alignment = 1 'Right Justify Caption = "$:" Height = 255 Left = -65280 TabIndex = 140 Top = 2760 Width = 195 End Begin VB.Label lblSuperNotes AutoSize = -1 'True Caption = "Notes to Super:" 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 = -69240 TabIndex = 139 Top = 3960 Width = 1350 End Begin VB.Label lblYardMemo AutoSize = -1 'True Caption = "Yard Order Notes" 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 = 540 TabIndex = 138 Top = 3600 Width = 1830 End Begin VB.Label lblOptMatPrice Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Mat. Price:" Height = 195 Left = -69540 TabIndex = 137 Top = 4500 Width = 765 End Begin VB.Label lblPayYds Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Pay Yards:" Height = 195 Left = -71025 TabIndex = 136 Top = 2385 Width = 765 End Begin VB.Label lblDiana AutoSize = -1 'True Caption = "Lot Notes:" 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 = 6000 TabIndex = 135 Top = 3600 Width = 1065 End End Begin VB.Label lblFoamAdj Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Caption = "Foam Adj. Yardage:" Height = 285 Left = 6525 TabIndex = 243 Top = 0 Width = 1980 End Begin VB.Label lblLaborAdj Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Caption = "Labor Adj. Yardage:" Height = 285 Left = 6525 TabIndex = 242 Top = 315 Width = 1980 End Begin VB.Label lblWireAdj Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Caption = "Wire Adj. Yardage:" Height = 285 Left = 6525 TabIndex = 241 Top = 615 Width = 1980 End Begin VB.Label lblStoneSqFt Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Caption = "Stone Sq. Ft.:" Height = 285 Left = 6525 TabIndex = 240 Top = 915 Width = 1980 End Begin VB.Label lblPaintSqFt Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Caption = "Paint Sq Ft: " Height = 285 Left = 6525 TabIndex = 239 Top = 1230 Width = 1980 End Begin VB.Label lblStone Alignment = 2 'Center Caption = "Stone Veneer" BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF00FF& Height = 360 Left = 8640 TabIndex = 225 Top = 1440 Visible = 0 'False Width = 3195 End Begin VB.Label lblSandShip Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 315 Left = 5580 TabIndex = 221 Top = 780 Width = 420 End Begin VB.Label lblSZone Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 6060 TabIndex = 220 Top = 780 Width = 315 End Begin VB.Label lblSynthetic Alignment = 2 'Center AutoSize = -1 'True Caption = "Synthetic Texture" BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF00FF& Height = 360 Left = 8970 TabIndex = 215 Top = 1440 Visible = 0 'False Width = 2475 End Begin VB.Label lblFirst Alignment = 2 'Center Caption = "First Time This Plan" BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H000000FF& Height = 375 Left = 8640 TabIndex = 212 Top = 1800 Visible = 0 'False Width = 3195 End Begin VB.Label lblSand Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Sand:" Height = 195 Left = 4620 TabIndex = 205 Top = 840 Width = 480 End Begin VB.Label lblJC Alignment = 1 'Right Justify Caption = "Job Cost:" Height = 375 Left = 2280 TabIndex = 29 Top = 2160 Width = 375 End Begin VB.Label lblPlan AutoSize = -1 'True Caption = "Double Click the Desired Plan" 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 = 8700 TabIndex = 27 Top = 840 Visible = 0 'False Width = 2565 End Begin VB.Label lblLathPrint AutoSize = -1 'True Caption = "Lath Order Printed" BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 360 Left = 9000 TabIndex = 25 Top = 2220 Visible = 0 'False Width = 2580 End Begin VB.Label lblTexture Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Finish:" Height = 195 Left = 8760 TabIndex = 23 Top = 120 Width = 450 End Begin VB.Label lblNote Alignment = 1 'Right Justify AutoSize = -1 'True Caption = " Plan Notes:" 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 = 3900 TabIndex = 21 Top = 1245 Width = 1275 End Begin VB.Label lblCMUYdge Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "CMU Yardage:" Height = 195 Left = 285 TabIndex = 17 Top = 2280 Width = 1050 End Begin VB.Label lblTtlYdge Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Total Yardage:" Height = 195 Left = 285 TabIndex = 16 Top = 1920 Width = 1050 End Begin VB.Label lblFin2 Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Finish 2 Ydge:" Height = 195 Left = 4710 TabIndex = 15 Top = 460 Width = 1005 End Begin VB.Label lbl28foam Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "2X8 Foam %tge:" Height = 195 Left = 4560 TabIndex = 14 Top = 120 Width = 1155 End Begin VB.Line linLotInfo BorderWidth = 2 X1 = 0 X2 = 11940 Y1 = 2640 Y2 = 2640 End Begin VB.Label lblModel Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Model/Elevation:" Height = 195 Left = 120 TabIndex = 13 Top = 1560 Width = 1215 End Begin VB.Label lblOwner Alignment = 1 'Right Justify Caption = "Owner:" Height = 195 Left = 660 TabIndex = 12 Top = 840 Width = 675 End Begin VB.Label lblAddress Alignment = 1 'Right Justify Caption = "Address:" Height = 195 Left = 540 TabIndex = 2 Top = 480 Width = 795 End Begin VB.Label lblLot Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Lot:" Height = 195 Left = 1065 TabIndex = 1 Top = 1200 Width = 270 End Begin VB.Label lblProject Alignment = 1 'Right Justify Caption = "SubDivision:" Height = 195 Left = 360 TabIndex = 0 Top = 120 Width = 975 End End Attribute VB_Name = "frmLotInfo" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim moRS As Recordset Dim moRSMat As Recordset, moRSCMat As Recordset Dim moRSPOpt As Recordset Dim moRSPOpt2 As Recordset Dim moRSLOpt As Recordset Dim moRSOptMat As Recordset Dim moRSProj As Recordset Dim moRSPlan As Recordset Dim moRSPO As Recordset Dim moRSPOMAT As Recordset Dim moRSMemo As Recordset Dim moRSPay As Recordset Dim moRSInvINFO As Recordset Dim mstrFoamAdj As String, mstrLaborAdj As String, mstrStone As String, mstrBEGQTY As String, mstrENDQTY As String Dim mboolBAD As Boolean, mboolSPLIT As Boolean, mstrWIRE As String, mboolFRMLOAD As Boolean Dim mstrPLANUP As String, mboolPLANUP As Boolean, mboolVERIFIED As Boolean Dim mboolSHOW As Boolean, mlngORDERID As Long, mintINVNO As String, mlngARINVID As Long Dim intCOUNT As Integer, mstrPROJLOT As String, mboolBADD As Boolean, mboolWRAP As Boolean Dim mboolAdding As Boolean, mstrINV As String, strTYPE As String, mlngINVID As Long Dim mstrType As String, mdblQTY As Double, mstrFILE As String, mintOpenPR As Integer Dim mlngFind As Long, mintBOOKMARK As Integer, mstrWireAdj As String ', mboolNoPrice As Boolean Dim mboolST_ADJ As Boolean, mintST_ADJ As Integer, mboolDNU As Boolean Dim mintTake138 As Integer, mintPONUM As Long, mbool2Dates As Boolean, mboolSTONE3 As Boolean 'For Printing Invoices Dim mintOPTID As Long, mintSUPPLIER As Integer, mstrSTARTDATE As String, mboolSTONE2 As Boolean Dim mstrSUPPLIER As String, mboolCRITICAL As Boolean, mboolCERTIFIED As Boolean, mboolHLNotes As Boolean Dim mbytREPRINT As Byte, mboolStone As Boolean, mboolPAINT As Boolean, mboolRPSTUCCO As Byte Dim mboolADD As Boolean, mboolCOMM As Boolean, mboolPLNCHANGE As Boolean, mstrPLNELEV As String Private Sub SetStone() Dim strSQL As String moRS!l_FLG = "P" moRS!y_FLG = "P" moRS!s_FLG = "P" moRS!z_FLG = "P" moRS!a_flg = vbTrue moRS!b_flg = vbTrue moRS!c_flg = vbTrue moRS!t_flg = vbTrue moRS!stone = vbTrue moRS.Update End Sub Private Sub PaintFix() Dim strResponse As String strResponse = Field2Str2(moRS!PNT_SQFT) strResponse = Field2Str2(InputBox("Enter The Correct Square Footage For The Paint", "Correct Paint", strResponse)) If strResponse = "" Or strResponse = 0 Then Exit Sub End If moRS!PNT_SQFT = Field2Str2(strResponse) If chkPaint = vbChecked Then mboolPAINT = True Else mboolPAINT = False End If moRS.Update Call FormShow End Sub Private Sub ListChanges() Dim oRS As Recordset, strSQL As String, strMSG As String strSQL = "SELECT * FROM tblCHANGE WHERE ChgDate > #" & gdteUPDATE & "#" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly ' If Not oRS.EOF Then Do Until oRS.EOF strMSG = strMSG & Field2Str(oRS!Chgdate) & " " & Field2Str(oRS!CHgInfo) strMSG = strMSG & vbCrLf & vbCrLf If Not oRS.EOF Then oRS.MoveNext End If Loop ' End If MsgBox strMSG, vbOKOnly, "Click OK To Continue" End Sub Private Sub RePrintLath() 'Allows a lath order to be reprinted Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin Dim oRS As Recordset 'but will keep a copy of the original orders printed Call LotChange(mstrPROJLOT, "Allow RePrint Lath") moRS!l_FLG = Null moRS!y_FLG = Null moRS!s_FLG = Null moRS!z_FLG = Null moRS!lorder = "12/31/2030" moRS!Border = Null moRS!TORDER = Null moRS!forder = Null moRS!corder = Null moRS!SORDER = Null moRS!VOrder = Null moRS!pmetal = 0 moRS!pylath = 0 moRS!pystucco = 0 moRS.Update moRSMemo!notes = Field2Str(moRSMemo!notes) & " - LATH PRINTING RESET ON " & Now() & " BY " & gstrLOGIN moRSMemo.Update strSQL = "SELECT * FROM tblOrders WHERE m_type = 'L' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRS!m_type = "H" oRS!d_flag = "X" oRS!ar_trans = vbChecked oRS!ap_trans = vbChecked oRS.Update oRS.MoveNext Loop strSQL = "SELECT * FROM tblLOTMATRL WHERE m_type = 'L' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRS!o_qty = 0 ' oRS!d_flag = "X" ' oRS!ar_trans = vbChecked ' oRS!ap_trans = vbChecked oRS.Update oRS.MoveNext Loop strSQL = "DELETE * FROM tblPaySheet where LotID = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblYardOrder where Lot_ID = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblARInvoice where Inv_Type = 'L' and lot_id = " & gintLOTID goConn.Execute strSQL Call LotRePrinted End Sub Private Sub cboPOType_LostFocus() If cboPOType.ListIndex = -1 Then cboPOType.ListIndex = 0 End If txtPOType = Left(cboPOType.Text, 1) gstrPO = txtPOType Select Case txtPOType Case "L" lblIssueTo = "Invoice Description:" txtIssueTo.Visible = True lblIssueTo.Visible = True lblDesc = "Pay Description:" txtPODesc.Visible = True lblDesc.Visible = True lblPayYds = "Pay Yards:" txtPay.Visible = True lblPayYds.Visible = True txtPayType.Visible = True optLath.Enabled = True optStucco.Enabled = True optSand.Enabled = True optPreOrder.Enabled = True optNone.Enabled = True optStone.Enabled = True Case "Y" lblIssueTo.Visible = False txtIssueTo.Visible = False lblDesc = "Supplier:" txtPODesc.Visible = True lblPayYds.Visible = False txtPay.Visible = False txtPayType.Visible = False optLath.Enabled = True optStucco.Enabled = True optSand.Enabled = True optPreOrder.Enabled = True optNone.Enabled = True optStone.Enabled = True Case "V" lblIssueTo = "Mileage:" txtIssueTo.Visible = True lblDesc = "Supplier:" txtPODesc.Visible = True lblPayYds.Visible = False txtPay.Visible = False txtPayType.Visible = False optLath.Enabled = False optStucco.Enabled = False optSand.Enabled = False optPreOrder.Enabled = False optNone.Enabled = True optStone.Enabled = True Case "M" lblIssueTo = "Person Requesting:" txtIssueTo.Visible = True lblDesc = "Supplier:" txtPODesc.Visible = True lblPayYds.Visible = False txtPay.Visible = False txtPayType.Visible = False optLath.Enabled = False optStucco.Enabled = False optSand.Enabled = False optPreOrder.Enabled = False optNone.Enabled = True optStone.Enabled = True End Select End Sub Private Sub chkHoldOrders_Click() cmdSaveLotInfo.Enabled = True If gbytSECURITY > 3 Then chkHoldOrders.Enabled = False chkHoldOrders.BackColor = &H80FFFF End If End Sub Private Sub chkHoldPO_Click() cmdSaveLotInfo.Enabled = True If gbytSECURITY > 3 Then chkHoldPO.Enabled = False chkHoldPO.BackColor = &H80FFFF End If End Sub Private Sub chkOthers_Click() cmdSaveLotInfo.Enabled = True End Sub Private Sub chkSplit_Click() cmdSaveLotInfo.Enabled = True ' lblSynthetic.Visible = True If gbytSECURITY > 3 Then ' chkSplit.Enabled = False ' chkSplit.BackColor = &H80FFFF End If End Sub Private Sub chkPaint_Click() If mboolFRMLOAD Then cmdSaveLotInfo.Enabled = True moRS!PNT_FLG = chkPaint Call PaintFix End If mboolFRMLOAD = True End Sub Private Sub chkStone_Click() If chkStone Then cmdSaveLotInfo.Enabled = True If chkOthers Then lblStone.Caption = "Stone By Others" chkOthers.BackColor = &HFF Else lblStone.Caption = "Stone Veneer" End If lblStone.Visible = True Else cmdSaveLotInfo.Enabled = True lblStone.Visible = False lblStoneSqFt.Caption = "Stone Square Ft.: 0" End If If gbytSECURITY > 3 Then chkStone.Enabled = False chkStone.BackColor = &H80FFFF End If End Sub Private Sub chkSynthetic_Click() cmdSaveLotInfo.Enabled = True If chkSynthetic Then cmdSaveLotInfo.Enabled = True lblSynthetic.Visible = True Else cmdSaveLotInfo.Enabled = True lblSynthetic.Visible = False End If If gbytSECURITY > 3 Then chkSynthetic.Enabled = False chkSynthetic.BackColor = &H80FFFF End If End Sub Private Sub cmdAddPOMat_Click() Call POMatClear gconACTION = 0 cmdSavePO.Enabled = False cmdDelPO.Enabled = False cmdAddPO.Enabled = False cmdAddPOMat.Enabled = False cmdDelPOMat.Enabled = False cmdSavePOMat.Enabled = True cmdPrintPO.Enabled = False txtPODate.Enabled = False txtPODesc.Enabled = False txtIssueTo.Enabled = False txtPay.Enabled = False txtPayType.Enabled = False txtPONotes.Enabled = False txtPOInvNo.Enabled = True txtPOMatDesc.Enabled = True txtPOQty.Enabled = True txtPOPrice.Enabled = True cboPODFlag.Enabled = True cboPOMType.Enabled = True cmdFindPOMat.Enabled = True mboolAdding = True txtPOInvNo.SetFocus End Sub Private Sub cmdBrownPrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer Dim oRS As Recordset, oRSS As Recordset Dim strSELECT As String, strSql2 As String, strSQLUP As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer Dim strORDERDATE As String, intCOPY As Integer, strPAY As String On Error GoTo Error_EH If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" strMSG = strMSG & Chr(10) & Chr(13) strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") ' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" If intResponse = vbYes Then Call cmdFindPlan_Click Call cmdCalc_Click cmdExit.Enabled = True End If ' Exit Sub End If If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If cmdExit.Enabled = False If chkHoldOrders Then MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" cmdExit.Enabled = True Exit Sub End If strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" cmdExit.Enabled = True Exit Sub End If gintCOPY = 1 ' If moRS!Split Then If mboolSPLIT Then strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly intPERCENT = Field2Str2(oRS!SUMPercent) If intPERCENT = 0 Then boolFPRINT = True Else boolFPRINT = False End If gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) If gintPERCENT = 0 Then MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" Exit Sub End If If (intPERCENT + gintPERCENT) > 100 Then MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" cmdExit.Enabled = True Exit Sub End If Else gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True End If If (intPERCENT + gintPERCENT) = 100 Then boolCOMPLETE = True End If gboolPRINT = True gstrPO = "L" gstrFLAG = "B" gstrTYPE = "S" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else strORDERDATE = Field2Str(oRS!order_date) ' glngORDERID = Field2Integer(oRS!order_id) gstrPONUM = Field2Str(oRS!po_num) ' If moRS!Split Then strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If oRS.EOF Then MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" Call Form_Load cmdExit.Enabled = True Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF strMSG = oRS!Desc If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then ' If moRS!Split Then If mboolSPLIT Then dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf strMSG = strMSG & "Qty For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = oRS!o_qty + dblOrder If dblCheck > oRS!qty Then dblOrder = oRS!qty - oRS!o_qty ' Else End If oRS!o_qty = oRS!o_qty + dblOrder oRS.Update Else dblOrder = oRS!qty End If oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!x_flag = vbChecked oRSS!o_qty = dblOrder oRSS!a_qty = dblOrder oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS.Update End If oRS.MoveNext Loop End If ' End If moRS!forder = strORDERDATE ' moRS!forder = Field2Str(oRS!order_date) If boolCOMPLETE Then moRS!b_flg = vbTrue End If moRS.Update End If If oRS.State = adStateOpen Then oRS.Close End If If oRSS.State = adStateOpen Then oRSS.Close End If crOrder.Reset strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\NewBrown.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset ' If chkSynthetic Then If boolCOMPLETE Then ' moRS!t_flg = vbTrue ' moRS.Update ' If Not moRS!Split Then If Not mboolSPLIT Then If Not moRSProj!bill Then Call PrintStuccoInv Else Call PrintCompleteInv End If boolFPRINT = False End If End If If boolFPRINT Then ' moRS!t_flg = vbTrue ' moRS.Update If Not moRSProj!bill Then Call PrintStuccoInv Else Call PrintCompleteInv End If End If ' End If txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" goConn.Execute strSQLUP strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" goConn.Execute strSQLUP moRS!PRNT_S = Now() moRS.Update strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" Set moRSPay = New Recordset moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic If moRS!PNT_Print Then MsgBox "Paint Pay and Invoices Have Already Been Printed", vbOKOnly, "Print Denied" Exit Sub Else If mboolPAINT Then MsgBox "Insert 1 White and The Necessary Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" gintCOPY = 1 intCOPY = 0 crOrder.Reset gstrMODULE = "Before Print Paint Pay " ' Call PrintPaintPay frmPaintPrtJobs.Show 1 Call PrintPaintIInv 'Needs to be added to LOTINFO5 Call PrintPaintEInv 'Needs to be added to LOTINFO5 Call PrintPaintFInv 'Needs to be added to LOTINFO5 txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRS!PNT_Print = vbChecked moRS.Update moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update End If End If gboolPRINT = False Call Form_Load End If cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdBrownPrint" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub cmdPaintPrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer Dim oRS As Recordset, oRSS As Recordset Dim strSELECT As String, strSql2 As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer Dim strORDERDATE As String, intCOPY As Integer, strPAY As String '***** If this procedure is activated, it will not print it again On Error GoTo Error_EH If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" strMSG = strMSG & Chr(10) & Chr(13) strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") ' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" If intResponse = vbYes Then Call cmdFindPlan_Click Call cmdCalc_Click cmdExit.Enabled = True End If ' Exit Sub End If If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If cmdExit.Enabled = False If chkHoldOrders Then MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" cmdExit.Enabled = True Exit Sub End If gintCOPY = 1 ' If moRS!Split Then '' If mboolSPLIT Then '' strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'B' and lot_id = " & gintLOTID '' Set oRS = New Recordset '' oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly '' intPERCENT = Field2Str2(oRS!SUMPercent) '' If intPERCENT = 0 Then '' boolFPRINT = True '' Else '' boolFPRINT = False '' End If '' gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) '' If gintPERCENT = 0 Then '' MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" '' Exit Sub '' End If '' If (intPERCENT + gintPERCENT) > 100 Then '' MsgBox "The Sum Of All Brown Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" '' cmdExit.Enabled = True '' Exit Sub '' End If '' Else gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True '' End If ' If (intPERCENT + gintPERCENT) = 100 Then ' boolCOMPLETE = True ' End If gboolPRINT = True gstrPO = "L" '***** Need To Make The Next Three Lines Work With Paint gstrFLAG = "B" gstrTYPE = "S" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else strORDERDATE = Field2Str(oRS!order_date) gstrPONUM = Field2Str(oRS!po_num) strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If oRS.EOF Then MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" Call Form_Load cmdExit.Enabled = True Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF strMSG = oRS!Desc If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then '' If mboolSPLIT Then '' dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) '' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) '' strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf '' strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf '' strMSG = strMSG & "Qty For This Order -- " & dblOrder '' dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) '' dblCheck = oRS!o_qty + dblOrder '' If dblCheck > oRS!qty Then '' dblOrder = oRS!qty - oRS!o_qty ' Else '' End If '' oRS!o_qty = oRS!o_qty + dblOrder '' oRS.Update '' Else dblOrder = oRS!qty '' End If oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!x_flag = vbChecked oRSS!o_qty = dblOrder oRSS!a_qty = dblOrder oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS.Update End If oRS.MoveNext Loop End If ' End If moRS!forder = strORDERDATE ' moRS!forder = Field2Str(oRS!order_date) If boolCOMPLETE Then moRS!b_flg = vbTrue End If moRS.Update End If If oRS.State = adStateOpen Then oRS.Close End If If oRSS.State = adStateOpen Then oRSS.Close End If crOrder.Reset strSQL = "{tblORDERS.PO_NUM}= '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\NewBrown.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\NewBrownM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset ' If chkSynthetic Then If boolCOMPLETE Then ' moRS!t_flg = vbTrue ' moRS.Update ' If Not moRS!Split Then If Not mboolSPLIT Then If Not moRSProj!bill Then Call PrintStuccoInv Else Call PrintCompleteInv End If boolFPRINT = False End If End If If boolFPRINT Then ' moRS!t_flg = vbTrue ' moRS.Update If Not moRSProj!bill Then ' ********** Deal with Paint PO, Invoice, and Pay Sheets Call PrintStuccoInv Else Call PrintCompleteInv End If End If ' End If txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% BROWN ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update moRS!PRNT_S = Now() moRS.Update strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" Set moRSPay = New Recordset moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic If moRS!PNT_Print Then MsgBox "Paint Pay and Invoices Have Already Been Printed", vbOKOnly, "Print Denied" Exit Sub Else If mboolPAINT Then MsgBox "Insert 1 White and 17 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" gintCOPY = 1 intCOPY = 0 crOrder.Reset gstrMODULE = "Before Print Paint Pay " Call PrintPaintPay Call PrintPaintIInv 'Needs to be added to LOTINFO5 Call PrintPaintEInv 'Needs to be added to LOTINFO5 Call PrintPaintFInv 'Needs to be added to LOTINFO5 txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRS!PNT_Print = vbChecked moRS.Update moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update End If End If ' txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "PAINT PAY SHEETS PRINTED - " & Now() & " BY " & gstrLOGIN & " " ' moRS!PNT_Print = vbChecked ' moRS.Update ' moRSMemo!notes = UCase(Field2Str(txtYardMemo)) ' moRSMemo.Update gboolPRINT = False ' cmdBrownPrint.Enabled = False Call Form_Load End If cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdPaintPrint" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub cmdCalc_Click() Dim strSQL As String strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID Set moRS = New Recordset moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID Set moRSProj = New Recordset moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If moRS!texture = "DF" Or moRS!texture = "MF" Or moRS!texture = "QS" Or moRS!texture = "RF" Then gbool2FIN = True Else gbool2FIN = False End If If moRS!texture = "DW" Then moRS!calcdate = Now ' moRS!calcdate = Date moRS.Update Else If moRSProj!stype <> "T" Then Call MatCalcOne Call ConvertSuper Call MatLoad Call CalcMetal Else Call MatCalcThree Call ConvertSuper Call MatLoad Call CalcMetal End If End If MsgBox "Materials Calculation is Complete" txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Now() & " BY " & gstrLOGIN & " " ' txtYardMemo = Field2Str(txtYardMemo) & " - CALC " & Date & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update End Sub Private Sub cmdDelLot_Click() Dim strSQL As String, strYN As String On Error GoTo Error_EH strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") If strYN = vbNo Then Exit Sub End If gconACTION = 3 strSQL = "DELETE * FROM tblLOption WHERE Lot_id = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblLotMatrl WHERE Lot_id = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblOrders WHERE Lot_id = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblPOrder WHERE Lot_id = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblPOrdMat WHERE Lot_id = " & gintLOTID goConn.Execute strSQL strSQL = "DELETE * FROM tblARInvoice WHERE Lot_id = " & gintLOTID goConn.Execute strSQL moRS.Delete gstrFLAG = "D" Call LotChange(mstrPROJLOT, "Delete Lot") Unload Me Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdDelLot" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdDelPO_Click() Dim strSQL As String Dim strYN As String strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") If strYN = vbNo Then Exit Sub End If gconACTION = 3 mintBOOKMARK = lstPO.ListIndex cmdDelPO.Enabled = False cmdAddPO.Enabled = True cmdSavePO.Enabled = False cmdPrintPO.Enabled = False cmdAddPOMat.Enabled = True cmdSavePOMat.Enabled = False cmdDelPOMat.Enabled = False strSQL = "DELETE * FROM tblPOrdmat where ponum = " & mintPONUM goConn.Execute strSQL strSQL = "DELETE * FROM tblPOrder WHERE PONum = " & mintPONUM goConn.Execute strSQL Call LotChange(mstrPROJLOT, "Delete PO") Call POLoad If lstPO.ListCount Then If lstPO.ListCount > mintBOOKMARK Then lstPO.ListIndex = mintBOOKMARK mintBOOKMARK = 0 Else lstPO.ListIndex = mintBOOKMARK - 1 End If Else mintBOOKMARK = -1 Call POMatClear Call POClear End If gconACTION = 0 End Sub Private Sub cmdDelPOMat_Click() Dim strYN As String strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") If strYN = vbNo Then Exit Sub End If gconACTION = 3 mintBOOKMARK = lstPOMaterial.ListIndex moRSPOMAT.Delete Call LotChange(mstrPROJLOT, "Delete PO Material") Call POMatLoad cmdAddPO.Enabled = True cmdSavePO.Enabled = False cmdDelPO.Enabled = False cmdPrintPO.Enabled = False cmdSavePOMat.Enabled = False cmdDelPOMat.Enabled = False cmdAddPOMat.Enabled = True If lstPOMaterial.ListCount Then If lstPOMaterial.ListCount > mintBOOKMARK Then lstPOMaterial.ListIndex = mintBOOKMARK mintBOOKMARK = 0 Else lstPOMaterial.ListIndex = mintBOOKMARK - 1 End If End If gconACTION = 0 End Sub Private Sub cmdEdit_Click() gconACTION = 5 cmdSaveMatrl.Enabled = True cmdCalc.Enabled = True cmdFindPlan.Visible = True cmdFindPlan.Enabled = True cmdOrders.Enabled = True cmdSaveLotInfo.Enabled = True cmdPrintCMU.Enabled = True cmdUpCMU.Enabled = True txtAddress.Enabled = True txtOwner.Enabled = True lstLOptions.Enabled = True lstPOptions.Enabled = True End Sub Private Sub cmdFindPOMat_Click() Dim oRS As Recordset, strTYPE As String Dim strSQL As String, lngFind As String, strFIND2 As String Dim strFIND As String, lngLSTI As Long, boolFound As Boolean On Error GoTo Error_EH strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtPOInvNo.Text & "' AND Inv_Type = " & gbytINV_TYPE Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If oRS.RecordCount > 0 Then With oRS txtPOInvNo = Field2Str(!inv_no) txtPOMatDesc = Field2Str(!Desc) txtPOPrice = Field2Str2(!price) If !d_flag = "S" Then cboPODFlag.Text = "Supplier" Else cboPODFlag.Text = "Yard" End If strTYPE = Field2Str(!m_type) Call FindType(cboPOMType, strTYPE) End With txtPOQty.SetFocus Else lstLOOKUP.Visible = True Call LoadILookUp ' lngFind = Field2Long(txtPOInvNo) lngFind = Field2Str(txtPOInvNo) strFIND2 = Field2Str(txtPOInvNo) lstLOOKUP.ListIndex = 0 ' Call ListFindItem2(lstLookup, lngFind) For lngLSTI = 0 To lstLOOKUP.ListCount - 1 lstLOOKUP.col = 0 strFIND = lstLOOKUP.ColText If StrComp(strFIND, strFIND2, vbTextCompare) = -1 Then ' If StrComp(strFIND, lstLOOKUP.List(lngLSTI), vbTextCompare) = 0 Then ' boolFound = True ' lstLookup.SetFocus ' lstLookup.ListIndex = lngLSTI ' Exit For ElseIf StrComp(strFIND, strFIND2, vbTextCompare) = 0 Then ' ElseIf StrComp(strFIND, lstLOOKUP.List(lngLSTI), vbTextCompare) = 0 Then ' ElseIf StrComp(strFIND, lstLookup.List(lngLSTI), vbTextCompare) = 1 Then boolFound = True lstLOOKUP.SetFocus lstLOOKUP.ListIndex = lngLSTI - 1 Exit For ElseIf StrComp(strFIND, strFIND2, vbTextCompare) = 1 Then ' ElseIf StrComp(strFIND, lstLOOKUP.List(lngLSTI), vbTextCompare) = 1 Then boolFound = True lstLOOKUP.SetFocus lstLOOKUP.ListIndex = lngLSTI - 1 Exit For End If lngLSTI = lngLSTI + 1 lstLOOKUP.ListIndex = lngLSTI Next End If oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdFindPOMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub LoadILookUp() Dim oRS As Recordset Dim strSQL As String Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstLOOKUP.Clear Do Until oRS.EOF With lstLOOKUP strLine = oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS!inv_no End With oRS.MoveNext Loop oRS.Close If lstLOOKUP.ListCount Then lstLOOKUP.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module LoadLookUp" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdIssue_Click() Dim lngTIE As Long Dim strSQL As String lngTIE = FindMax2("tblYardOrder", "split", "LOT_ID", gintLOTID) If mboolSPLIT Then ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE crOrder.ReportFileName = App.Path & "\issue2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.Formulas(4) = 1 crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset Else ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE crOrder.ReportFileName = App.Path & "\issue.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Formulas(4) = 1 ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset End If cmdIssue.Visible = False End Sub Private Sub cmdJCSetup_Click() Call JCSetup End Sub Private Sub cmdLathPay_Click() Dim strPAY As String Dim bytINFO As Byte strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" Set moRSPay = New Recordset moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic bytINFO = InputBox("Enter the Number of Times to Divide This Paysheet", "RePrint Lath", 1) If bytINFO = 1 Then gintCOPY = 1 ElseIf bytINFO = 2 Then gintCOPY = 3 ElseIf bytINFO = 3 Then gintCOPY = 5 ElseIf bytINFO = 4 Then gintCOPY = 7 ElseIf bytINFO = 5 Then gintCOPY = 9 End If Call LotChange(mstrPROJLOT, "RePrint Lath Pay") Call PrintLathPay cmdLathPay.Visible = False End Sub Private Sub cmdLathPrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intYN As Integer Dim oRS As Recordset, oRSS As Recordset, intResponse As Integer Dim strSELECT As String, strSql2 As String, strMSG As String, strMSG2 As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strSQLUP As String Dim strPAY As String, dblBal As Double, intCOPY As Integer, intTCPAY As Integer '*** FIX On Error GoTo Error_EH mboolRPSTUCCO = False ' If mstrPLANUP > Field2Str(moRS!CalcDate) Then ' strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" ' strMSG = strMSG & Chr(10) & Chr(13) ' strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" ' MsgBox strMSG, vbYesNo, "Recalculate Recommended" ' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" ' If intResponse = vbYes Then ' Call cmdFindPlan_Click ' Call cmdCalc_Click ' End If ' Exit Sub ' End If If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If If Not moRSProj!setup Then MsgBox "The Lot Setup is not Completed - Contact Accounts Receivable - No Lath Order Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If cmdExit.Enabled = False Call GetPlanInfo ' If mboolPLANUP Then If IsNull(moRS!calcdate) Then MsgBox "Lot Must Be Calculated Before Printing Lath", vbOKOnly, "Calculate Lot" Exit Sub End If If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then MsgBox "Plan Information Has Been Updated - Click on Binoculars and Recalculate before Printing", vbOKOnly, "Must Update" cmdExit.Enabled = True Exit Sub End If strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" Set moRSPay = New Recordset moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic ' If moRSPay.EOF Then ' End If gintCOPY = 1 ' If moRS!Split Then If mboolSPLIT Then strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'L' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly intPERCENT = Field2Str2(oRS!SUMPercent) If intPERCENT = 0 Then boolFPRINT = True Else boolFPRINT = False End If gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) If gintPERCENT = 0 Then MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" Exit Sub End If If (intPERCENT + gintPERCENT) > 100 Then MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" cmdExit.Enabled = True Exit Sub End If Else gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True End If If (intPERCENT + gintPERCENT) = 100 Then boolCOMPLETE = True End If If txtSuperBB = 0 And txtSuper12 = 0 Then MsgBox "No Superintendent's Statistics have been entered", vbCritical + vbOKOnly, "No Lath Print Allowed" cmdExit.Enabled = True Exit Sub End If ' strSQL = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" strSQL = "SELECT * FROM tblPlanBill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then MsgBox "The Lot Start Date is Earlier Than The Billing Effective Date - Fix It", vbOKOnly, "Will Not Work" cmdExit.Enabled = True Exit Sub End If If Not moRSProj!bill And Field2Str2(oRS!l_bill) = 0 Then MsgBox "No Lath Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" cmdExit.Enabled = True Exit Sub End If If Field2Str2(oRS!s_bill) = 0 Then MsgBox "No Stucco Price in for this Plan - No Lath Can Be Printed", vbOKOnly, "No Pricing" cmdExit.Enabled = True Exit Sub End If gboolPRINT = True gstrPO = "L" gstrFLAG = "L" gstrTYPE = "Y" Call ShowPrint gstrMODULE = "After Show Print" If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID ' & " and d_flag = 'S' and m_type = 'L'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic gstrMODULE = "Step 1 " If oRS.EOF Then Else ' glngORDERID = Field2Integer(oRS!order_id) gstrPONUM = Field2Str(oRS!po_num) moRS!lorder = Field2Str(oRS!order_date) moRS.Update End If gstrMODULE = "Step 2 " strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic gstrMODULE = "Step 3 " If oRS.EOF Then MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF ' If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then '***************** need to move this to Issue and Make a unique identifier If Field2Single(oRS!qty) > Field2Single(oRS!o_qty) Then ' If moRS!Split Then If mboolSPLIT Then dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) dblBal = Field2Double(oRS!qty) - Field2Double(oRS!o_qty) dblBal = Round(dblBal, 2) If dblOrder > dblBal Then dblOrder = dblBal End If strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf strMSG = strMSG & "Balance Available -- " & Field2Str2(oRS!qty) - Field2Str(oRS!o_qty) & vbCrLf strMSG = strMSG & "Qty For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = oRS!o_qty + dblOrder If dblCheck > oRS!qty Then dblOrder = oRS!qty - oRS!o_qty ' Else End If oRS!o_qty = oRS!o_qty + dblOrder oRS.Update Else dblOrder = oRS!qty End If ' strMSG = strMSG & "Qty For This Order -- " & Int((((oRS!qty - oRS!o_qty) * gintPERCENT) / 100) + 0.99) oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!o_qty = dblOrder oRSS!x_flag = vbChecked oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS!a_qty = dblOrder oRSS.Update End If oRS.MoveNext Loop End If gstrMODULE = "Step 4 " If oRS.State = adStateOpen Then oRS.Close End If gstrMODULE = "Step 5 " If oRSS.State = adStateOpen Then oRSS.Close End If gstrMODULE = "Before Print Lath PO" 'glngORDERID MsgBox "Insert A PINK Sheet of Paper for the Delivery Sheet and then Press Enter", vbOKOnly, "InsertPaper" ' strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\NewLath2.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\NewLath2M.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter gintCOPY = 1 'Added 8/1/17 to make the report only print 1 copy crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset gintCOPY = 2 If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\NewLath.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\NewLathM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset gintCOPY = 1 txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SUPPLIER LATH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and (m_type = 'L' or m_type = 'P')" goConn.Execute strSQLUP strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" goConn.Execute strSQLUP moRS!PRNT_L = Now() moRS.Update If boolFPRINT Then gstrMODULE = "Before Print Actual " Call PrintActual gintCOPY = 1 crOrder.Reset End If ' If boolFPRINT Then gstrMODULE = "Before Print Issue Ticket " Call PrintIssue gintCOPY = 1 crOrder.Reset ' End If If boolFPRINT Then gstrMODULE = "Before Print Lath Material Report " Call PrintLathMat crOrder.Reset ' crOrder.Reset ' Load frmEPElev ' Unload frmEPElev If Not chkNoPay Then ' If Field2Str2(txtTtlYdge) - 19 > 1200 Then ' intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) ' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 4 ' Else ' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 2 ' End If ' If Field2Str2(txtTtlYdge) - 19 > 1200 Then intCOPY = Int(((txtTtlYdge - 19) / 1200) + 0.99) gintCOPY = intCOPY * 2 If mboolCERTIFIED Then strMSG2 = "Insert " & gintCOPY & " Sheet of BABY BLUE Paper for the Lath Pay Sheets and then Press Enter" Else strMSG2 = "Insert " & gintCOPY & " Sheet of YELLOW Paper for the Lath Pay Sheets and then Press Enter" End If MsgBox strMSG2, vbOKOnly, "InsertPaper" ' gintCOPY = intCOPY * 2 ' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' MsgBox "Insert 4 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 4 ' Else ' MsgBox "Insert 2 Sheets of Paper for the Lath Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 2 ' End If gstrMODULE = "Before Print Lath Pay " Call PrintLathPay ' If mboolPAINT Then ' MsgBox "Insert 1 White and 10 Color Sheets of Paper for the Paint Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 1 ' intCOPY = 0 ' crOrder.Reset ' gstrMODULE = "Before Print Paint Pay " ' Call PrintPaintPay ' End If gintCOPY = 1 intCOPY = 0 crOrder.Reset gstrMODULE = "Before Print Stucco Pay " If moRSProj!stype <> "T" Then If Field2Str2(txtTtlYdge) - 24 > 1200 Then intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) ' gintCOPY = 1 gintCOPY = intCOPY * 2 MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' MsgBox "Insert " & gintCOPY & " Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 4 If mboolST_ADJ Then Call PrintStuccoPay2 Else Call PrintStuccoPay End If crOrder.Reset gintCOPY = 1 Else If moRS!texture <> "SB" Then ' MsgBox "Insert 1 Sheet of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 1 MsgBox "Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" gintCOPY = 2 If mboolST_ADJ Then Call PrintStuccoPay2 Else Call PrintStuccoPay End If crOrder.Reset gintCOPY = 1 ElseIf moRS!texture = "SF" Then MsgBox "**STONE** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" gintCOPY = 1 ' MsgBox "**STONE** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" ' gintCOPY = 2 Call PrintStuccoStone crOrder.Reset gintCOPY = 1 Else MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" gintCOPY = 1 ' MsgBox "**SYNTHETIC** Insert 4 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" ' gintCOPY = 2 Call PrintStuccoSyn crOrder.Reset gintCOPY = 1 End If End If Else If Field2Str2(txtTtlYdge) - 24 > 1200 Then intCOPY = Int(((txtTtlYdge - 24) / 1200) + 0.99) gintCOPY = intCOPY * 1 intTCPAY = gintCOPY * 1 ' gintCOPY = intCOPY * 2 ' intTCPAY = gintCOPY * 3 MsgBox "Insert " & intTCPAY & " Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 4 Call PrintStuccoThree crOrder.Reset gintCOPY = 1 Else MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" gintCOPY = 1 ' MsgBox "Insert 6 Sheets of Paper for the Three Coat Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' gintCOPY = 2 Call PrintStuccoThree crOrder.Reset gintCOPY = 1 End If End If gintCOPY = 1 If Field2Integer(moRS!CMU) > 0 Then intYN = MsgBox("Do You Want To Print A CMU Pay Sheet At This Time?", vbYesNo, "CMU Pay Sheet") If intYN = vbYes Then Call cmdPrintCMU_Click crOrder.Reset End If End If End If End If '****** Print Stone Pay Sheet and Invoice '****** Removed 06/27/05 per Rose ' If Not chkNoPay Then ' If moRS!ostone And Not moRS!otstone Then ' crOrder.Reset ' MsgBox "Insert 2 Sheets of Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" ' gintCOPY = 2 ' strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" ' crOrder.ReportFileName = App.Path & "\StonePay.rpt" ' crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow ' crOrder.Destination = crptToPrinter ' crOrder.Action = 1 ' If boolCOMPLETE Then ' Call PrintStoneInv ' crOrder.Reset ' End If ' End If ' End If If moRS!Firsttime Then MsgBox "This is the first time for this plan - HOLD PAY SHEETS!", vbOKOnly, "HOLD PAY SHEETS" End If If boolCOMPLETE Then ' gintCOPY = 1 ' crOrder.Reset ' If Not moRS!Split Then ' If Not moRSProj!bill Then ' Call PrintLathInv ' crOrder.Reset ' End If ' End If moRS!l_FLG = "P" moRS!y_FLG = "P" moRS!s_FLG = "P" moRS!z_FLG = "P" ' cmdLathPrint.Enabled = False End If If boolFPRINT Then gintCOPY = 1 crOrder.Reset If Not moRSProj!bill Then Call PrintLathInv crOrder.Reset End If ' moRS!l_flg = "P" ' moRS!y_flg = "P" ' moRS!S_flg = "P" ' cmdLathPrint.Enabled = False End If End If If moRSProj!BagSand Then moRS!Border = Field2Str(moRS!lorder) moRS!a_flg = True txtYardMemo = Field2Str(txtYardMemo) & " " & "THIS LOT USED BAG SAND - " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update End If moRS.Update gintCOPY = 1 gboolPRINT = False ' cmdLathPrint.Enabled = False Call Form_Load cmdExit.Enabled = True If moRSPay.State = adStateOpen Then moRSPay.Close End If Exit Sub Error_EH: gstrMODULE = gstrMODULE & " Form LotInfo - Module cmdLathPrint" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub PrintLathPay() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\lathpay_17.rpt" ' crOrder.ReportFileName = App.Path & "\lathpay.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\lathpayM_17.rpt" ' crOrder.ReportFileName = App.Path & "\lathpayM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY 'May need to set to 1 if still printing multiple copies 8/1/2017 ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter If gintCOPY > 1 Then intTOTAL = Int((gintCOPY / 2) + 0.99) Else intTOTAL = 1 End If intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) i = 1 If gintCOPY > 3 Then crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!l_yds / intTOTAL) + 0.99) intMETAL = Int((moRS!METAL / intTOTAL) + 0.99) i = 1 Do Until i = (Int((gintCOPY / 2)) + 1) crOrder.Formulas(1) = "PaySheetCount = " & i crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" crOrder.CopiesToPrinter = 2 ' crOrder.CopiesToPrinter = gintCOPY / 2 crOrder.Action = 1 moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "L" moRSPay!worktype = "P" moRSPay!pay_ydge = intYDS moRSPay!METAL = intMETAL moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update moRS!pylath = Field2Integer(moRS!pylath) + intYDS moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL moRS!multipay = vbChecked moRS.Update i = i + 1 Loop crOrder.Reset ' Exit Sub Else crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "L" moRSPay!worktype = "C" moRSPay!pay_ydge = intYDS moRSPay!METAL = intMETAL moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update moRS!pylath = Field2Integer(moRS!pylath) + intYDS moRS!pmetal = Field2Integer(moRS!pmetal) + intMETAL moRS.Update End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintLathPay" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPaintPay() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayCover.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PREP" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!PREPL = vbTrue moRS.Update '*** End Prep Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPINT.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PINT" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!PREPL = vbTrue moRS.Update '*** End Prep Int Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPEXT.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PEXT" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!PREPL = vbTrue moRS.Update '*** End Prep Ext Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "IS" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!ISL = vbTrue moRS.Update '*** End IS Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "BT1" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!BT1L = vbTrue moRS.Update '*** End BT1 Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "BT2" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!BT2L = vbTrue moRS.Update '*** End BT2 Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayES.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "ES" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!ESL = vbTrue moRS.Update '*** End ES Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "2T" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!TwoTL = vbTrue moRS.Update '*** End 2T Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "FS" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!FSL = vbTrue moRS.Update '*** End FS Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "OH" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!OHL = vbTrue moRS.Update '*** End OH Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "FG1" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!FG1L = vbTrue moRS.Update '*** End FG1 Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "F2" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!F2L = vbTrue moRS.Update '*** End F2 Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "CC" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!CCL = vbTrue moRS.Update '*** End CC Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "FG2" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!FG2L = vbTrue moRS.Update '*** End FG2 Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PO" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!POL = vbTrue moRS.Update '*** End PO Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "CS" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!CSL = vbTrue moRS.Update '*** End CS Pay Sheet strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "WH" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update moRS!WHL = vbTrue moRS.Update '*** End WH Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPaintPay" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPPrep() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPREP.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PREP" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End Prep Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPPrep" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPPINT() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPINT.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PINT" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End Prep INT Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPPINT" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPPEXT() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPEXT.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PEXT" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End Prep EXT Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPPEXT" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPIS() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayIS.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "IS" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End IS Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPIS" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPES() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer 'Need To Complete the ability to print one On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayES.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "ES" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End ES Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPES" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPP2T() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpay2T.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "2T" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End 2T Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPP2T" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPOH() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayOH.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "OH" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End OH Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPOH" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPFS() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayFS.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "FS" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End FS Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPFS" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPF2() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayF2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "F2" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End F2 Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPF2" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPFG1() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayFG1.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "FG1" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End FG1 Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPFG1" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPFG2() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayFG2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "FG2" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End FG2 Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPFG2" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPBT1() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayBT1.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "BT1" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End BT1 Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPBT1" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPBT2() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayBT2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "BT2" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End BT2 Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPBT2" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPPO() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayPO.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "PO" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End PO Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPPO" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPCS() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayCS.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "CS" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End CS Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPCS" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPWH() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayWH.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "WH" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End WH Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPWH" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPPCC() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer, intMETAL As Integer On Error GoTo Error_EH gintCOPY = 1 strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\paintpayCC.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!PNT_SQFT / intTOTAL) + 0.99) i = 1 crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "X" moRSPay!worktype = "CC" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay!cocode = 0 moRSPay.Update '*** End CC Pay Sheet Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPPCC" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoPay() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer On Error GoTo Error_EH strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\stuccopay_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" End If ' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) i = 1 If gintCOPY > 3 Then crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) i = 1 Do Until i = ((gintCOPY / 2) + 1) crOrder.Formulas(1) = "PaySheetCount = " & i crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" crOrder.CopiesToPrinter = 2 ' crOrder.CopiesToPrinter = gintCOPY / 2 crOrder.Action = 1 moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "P" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS moRS!multipay = vbChecked moRS.Update i = i + 1 Loop crOrder.Reset Exit Sub Else crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "C" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS moRS.Update End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoPay" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoPay2() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer On Error GoTo Error_EH strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\stuccopayB2_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" ElseIf moRSProj!cocode = 1 Then MsgBox "This is not setup for Metro Stucco - Exiting", vbOKOnly, "Invalid Company" Exit Sub ' crOrder.ReportFileName = App.Path & "\stuccopayM_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopayM.rpt" End If ' crOrder.ReportFileName = App.Path & "\stuccopay.rpt" crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) i = 1 '' If gintCOPY > 3 Then '' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) '' intTOTAL = Int((gintCOPY / 2) + 0.99) '' intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) '' i = 1 '' Do Until i = ((gintCOPY / 2) + 1) '' crOrder.Formulas(1) = "PaySheetCount = " & i '' crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" '' crOrder.CopiesToPrinter = 2 ' crOrder.CopiesToPrinter = gintCOPY / 2 '' crOrder.Action = 1 '' moRSPay.AddNew '' moRSPay!lotid = gintLOTID '' moRSPay!Type = "S" '' moRSPay!worktype = "P" '' moRSPay!pay_ydge = intYDS '' moRSPay!sheet = i '' moRSPay!Create = gstrLOGIN '' moRSPay!printed = vbChecked '' moRSPay!totalsheet = intTOTAL '' If moRSProj!cocode = 0 Then '' moRSPay!cocode = 0 '' ElseIf moRSProj!cocode = 1 Then '' moRSPay!cocode = 1 '' End If '' moRSPay.Update '' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS '' moRS!multipay = vbChecked '' moRS.Update '' i = i + 1 '' Loop '' crOrder.Reset '' Exit Sub '' Else '**** This will Print the Pay Sheet for Brown crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 ' crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "B" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS moRS.Update 'This will print the Pay Sheet for Texture crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "T" moRSPay!pay_ydge = (intYDS - mintST_ADJ) moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update ' End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoPay2" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoThree() Dim strSQL As String, i As Integer Dim intTOTAL As Integer, intYDS As Integer Dim bytYNSC As Byte, bytYNBR As Byte, bytYNTX As Byte, bytYNALL As Byte On Error GoTo Error_EH If mboolRPSTUCCO = True Then bytYNSC = MsgBox("Do You Want To Print A Scratch Pay Sheet?", vbYesNo, "Print Scratch PaySheets") If bytYNSC = vbYes Then ElseIf bytYNSC = vbNo Then bytYNBR = MsgBox("Do You Want To Print A Brown Pay Sheet?", vbYesNo, "Print Scratch PaySheets") If bytYNBR = vbYes Then ElseIf bytYNBR = vbNo Then bytYNTX = MsgBox("Do You Want To Print A Texture Pay Sheet?", vbYesNo, "Print Scratch PaySheets") If bytYNTX = vbYes Then Else bytYNALL = vbYes End If End If End If Else bytYNALL = vbYes End If If bytYNSC = vbYes Or bytYNALL = vbYes Then strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\stuccopayS_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopayS.rpt" ' crOrder.CopiesToPrinter = gintCOPY crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter intTOTAL = (gintCOPY) ' intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) i = 1 ' crOrder.Action = 1 If gintCOPY > 3 Then crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) i = 1 Do Until i = ((gintCOPY / 2) + 1) crOrder.Formulas(1) = "PaySheetCount = " & i crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY / 2 crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "S" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!printed = vbChecked moRSPay!Create = gstrLOGIN moRSPay!totalsheet = intTOTAL moRSPay.Update moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS moRS!multipay = vbChecked moRS.Update i = i + 1 Loop ' Exit Sub Else crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "S" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay.Update moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS moRS.Update End If End If If bytYNBR = vbYes Or bytYNALL = vbYes Then strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\stuccopayB_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopayb.rpt" ' crOrder.CopiesToPrinter = gintCOPY crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter i = 1 If gintCOPY > 3 Then crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) i = 1 Do Until i = ((gintCOPY / 2) + 1) crOrder.Formulas(1) = "PaySheetCount = " & i crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY / 2 crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "B" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay.Update i = i + 1 Loop ' Exit Sub Else crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "B" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay.Update End If End If ' crOrder.Action = 1 If bytYNTX = vbYes Or bytYNALL = vbYes Then strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\stuccopayT_17.rpt" ' crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" ' crOrder.CopiesToPrinter = gintCOPY crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter i = 1 If gintCOPY > 3 Then crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) i = 1 Do Until i = ((gintCOPY / 2) + 1) crOrder.Formulas(1) = "PaySheetCount = " & i crOrder.Formulas(3) = "PaySheetX = 'PARTIAL PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY / 2 crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "T" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL moRSPay.Update i = i + 1 Loop ' Exit Sub Else crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "S" moRSPay!worktype = "T" moRSPay!pay_ydge = intYDS moRSPay!sheet = i moRSPay!printed = vbChecked moRSPay!Create = gstrLOGIN moRSPay!totalsheet = intTOTAL moRSPay.Update End If End If mboolRPSTUCCO = False ' crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoThree" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoSyn() Dim strSQL As String Dim intTOTAL As Integer, intYDS As Integer On Error GoTo Error_EH strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.Reset crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) ' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = 1 ' intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "Y" moRSPay!worktype = "B" moRSPay!pay_ydge = intYDS moRSPay!sheet = 1 moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update ' moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS ' moRS.Update crOrder.Reset crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY) ' crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = 1 ' intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) crOrder.ReportFileName = App.Path & "\stuccopayT.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter crOrder.Formulas(3) = "PaySheetX = 'SYNTHETIC FINISH PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "Y" moRSPay!worktype = "T" moRSPay!pay_ydge = intYDS moRSPay!sheet = 1 moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update moRS!pystucco = Field2Integer(moRS!pystucco) + intYDS moRS.Update Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoSyn" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoStone() Dim strSQL As String Dim intTOTAL As Integer, intYDS As Integer On Error GoTo Error_EH strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.Reset crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\stuccopayB.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\stuccopayBM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "V" moRSPay!worktype = "C" moRSPay!pay_ydge = intYDS moRSPay!sheet = 1 moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update crOrder.Reset crOrder.Formulas(2) = "PaySheetTotal = " & (gintCOPY / 2) intTOTAL = Int((gintCOPY / 2) + 0.99) intYDS = Int((moRS!s_yds / intTOTAL) + 0.99) If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\stuccopayTS.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\stuccopayTSM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.Destination = crptToPrinter crOrder.Formulas(3) = "PaySheetX = 'STONE FINISH PAY SHEET'" crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset moRSPay.AddNew moRSPay!lotid = gintLOTID moRSPay!Type = "V" moRSPay!worktype = "C" moRSPay!pay_ydge = intYDS moRSPay!sheet = 1 moRSPay!Create = gstrLOGIN moRSPay!printed = vbChecked moRSPay!totalsheet = intTOTAL If moRSProj!cocode = 0 Then moRSPay!cocode = 0 ElseIf moRSProj!cocode = 1 Then moRSPay!cocode = 1 End If moRSPay.Update Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoStone" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintIssueHold() Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String Dim oRS As Recordset, oRSS As Recordset On Error GoTo Error_EH strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" Set oRSS = New Recordset oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic strSQL = "SELECT inv_no, price FROM tblInvtry" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If Not oRS.EOF Then Do Until oRSS.EOF strSELECT = "inv_no = '" & Field2Str(oRSS!inv_no) & "'" oRS.MoveFirst oRS.Find strSELECT If Not oRS.EOF Then oRSS!price = Field2Str2(oRS!price) ' oRSS!price = Str2Field(oRS!price) oRSS.Update End If oRSS.MoveNext Loop End If oRS.Close oRSS.Close strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic If oRS.RecordCount > 0 Then strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID goConn.Execute strYARD End If strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" Set oRSS = New Recordset oRSS.Open strYARD, goConn, adOpenForwardOnly, adLockReadOnly Do Until oRSS.EOF oRS.AddNew oRS!LOT_ID = gintLOTID oRS!inv_no = Field2Str(oRSS!inv_no) oRS!Desc = Field2Str(oRSS!Desc) oRS!qty = Field2Str2(oRSS!qty) oRS!qtyIssue = Field2Str2(oRSS!qty) oRS!price = Field2Str2(oRSS!price) oRS!po_num = "ORIGINAL ORDER" oRS!createuser = gstrLOGIN oRS!UpdateUser = gstrLOGIN oRS.Update oRSS.MoveNext Loop txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" crOrder.ReportFileName = App.Path & "\issue.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintIssueHold" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintIssue() Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String Dim oRS As Recordset, oRSS As Recordset, dblOrder As Double, dblBal As Double, dblCheck As Double Dim lngP_Qty As Long, lngO_Qty As Long, lngSHIPPED As Long, strSQLUP As String Dim oRSYS As Recordset, strSYS As String, lngTIE As Long, strMSG As String Dim boolSPLIT As Boolean '*** FIX On Error GoTo Error_EH boolSPLIT = False strSYS = "SELECT * FROM tblSYSINFO" Set oRSYS = New Recordset oRSYS.Open strSYS, goConn, adOpenKeyset, adLockOptimistic lngTIE = oRSYS!Split oRSYS!Split = oRSYS!Split + 1 oRSYS.Update strPRICE = "SELECT lot_id, Inv_no, Price from tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" Set oRSS = New Recordset oRSS.Open strPRICE, goConn, adOpenKeyset, adLockOptimistic strSQL = "SELECT inv_no, price FROM tblInvtry" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If Not oRS.EOF Then Do Until oRSS.EOF strSELECT = "inv_no = '" & Field2Str(oRSS!inv_no) & "'" oRS.MoveFirst oRS.Find strSELECT If Not oRS.EOF Then oRSS!price = Field2Str2(oRS!price) ' oRSS!price = Str2Field(oRS!price) oRSS.Update End If oRSS.MoveNext Loop End If oRS.Close oRSS.Close strSELECT = "SELECT * FROM tblYardOrder WHERE Lot_ID = " & gintLOTID & " AND split >= " & lngTIE Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic If oRS.RecordCount > 0 Then strYARD = "DELETE * FROM tblYardOrder WHERE Lot_id = " & gintLOTID goConn.Execute strYARD End If strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" Set oRSS = New Recordset oRSS.Open strYARD, goConn, adOpenKeyset, adLockOptimistic Do Until oRSS.EOF If CDbl(Field2Str2(oRSS!qty)) > CDbl(Field2Str2(oRSS!o_qty)) Then ' If moRS!Split Then If mboolSPLIT Then ' mboolSPLIT = True dblOrder = Int((((oRSS!qty) * gintPERCENT) / 100) + 0.99) dblBal = Field2Double(oRSS!qty) - Field2Double(oRSS!o_qty) dblBal = Round(dblBal, 2) If dblOrder > dblBal Then dblOrder = dblBal End If strMSG = "Item -- " & Trim$(Field2Str(oRSS!Desc)) & vbCrLf strMSG = strMSG & "Original Qty -- " & Field2Str2(oRSS!qty) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(oRSS!o_qty) & vbCrLf strMSG = strMSG & "Balance Available -- " & Field2Str2(oRSS!qty) - Field2Str(oRSS!o_qty) & vbCrLf strMSG = strMSG & "Qty For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = oRSS!o_qty + dblOrder If dblCheck > oRSS!qty Then dblOrder = oRSS!qty - oRSS!o_qty End If ' oRSS!o_qty = oRSS!o_qty + dblOrder oRSS.Update Else dblOrder = oRSS!qty End If oRS.AddNew oRS!LOT_ID = gintLOTID oRS!inv_no = Field2Str(oRSS!inv_no) oRS!Desc = Field2Str(oRSS!Desc) oRS!qty = dblOrder oRS!qtyIssue = dblOrder ' oRS!qty = Field2Str2(oRSS!qty) ' oRS!qtyIssue = Field2Str2(oRSS!qty) oRS!price = Field2Str2(oRSS!price) If mboolSPLIT Then oRS!po_num = "PARTIAL ORDER" Else oRS!po_num = "ORIGINAL ORDER" End If oRS!createuser = gstrLOGIN oRS!UpdateUser = gstrLOGIN oRS!Split = lngTIE oRS.Update lngSHIPPED = Field2Str2(oRSS!o_qty) oRSS!o_qty = lngSHIPPED + Field2Str2(oRS!qtyIssue) oRSS.Update End If oRSS.MoveNext Loop strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'Y' and (M_Type = 'L' or M_Type = 'P')" goConn.Execute strSQLUP If mboolSPLIT Then txtYardMemo = Field2Str(txtYardMemo) & " PARTIAL YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " Else txtYardMemo = Field2Str(txtYardMemo) & " YARD ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " End If moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update ' crOrder.Formulas(1) = "PaySheetCount = " & i crOrder.Formulas(3) = "Z_SPLIT = " & lngTIE If mboolSPLIT Then ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\issue2.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\issue2M.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset Else ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and {tblLOTMATRL.D_Flag} = 'Y' and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P') AND {tblYARDORDER.SPLIT} = }" & lngTIE strSQL = "{tblYARDORDER.lot_id} = " & gintLOTID & " AND {tblYARDORDER.SPLIT} = " & lngTIE If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\issue.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\issueM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintIssue" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintLathMat() Dim strSQL As String On Error GoTo Error_EH strSQL = "{tbllotmatrl.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'L' or {tblLOTMATRL.M_Type} = 'P')" If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\lathmat.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\lathmatM.rpt" End If ' crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.ReplaceSelectionFormula (strSQL) crOrder.ReplaceSelectionFormula (strSQL) gintCOPY = 1 'Changed to 1 on 8/1/17 to stop multiple copies crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintLathMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoMat() Dim strSQL As String On Error GoTo Error_EH strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID & " and ({tblLOTMATRL.M_Type} = 'B' or {tblLOTMATRL.M_Type} = 'S' or {tblLOTMATRL.M_Type} = 'T')" crOrder.ReportFileName = App.Path & "\stuccomat.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY 'May need to change this to 1 if printing more than 1 8/1/2017 ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub ShowPrint() Dim oRS As Recordset Dim strSQL As String, lngPO As Long On Error GoTo Error_EH strSQL = "SELECT * FROM tblSYSInfo" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic lngPO = Field2Long(oRS!nextpo) gstrMODULE = "Line 8" lngPO = lngPO + 1 If lngPO > 99999 Then lngPO = 1 End If oRS!nextpo = lngPO oRS.Update gstrMODULE = gstrMODULE & " Line 15" Load frmPrint gstrMODULE = gstrMODULE & " Line 18" frmPrint.txtJobCost = Field2Str(moRS!jobcost) frmPrint.txtPONum = Trim(Field2Str(moRSProj!Proj_Code)) ' gstrPONUM = Trim(Field2Str(moRSProj!proj_code)) gstrMODULE = gstrMODULE & " Line 20" frmPrint.txtPONum = frmPrint.txtPONum & Trim(Field2Str(moRS!lot_no)) ' gstrPONUM = gstrPONUM & Trim(Field2Str(moRS!lot_no)) gstrMODULE = gstrMODULE & " Line 22" frmPrint.txtPONum = frmPrint.txtPONum & Format(lngPO, "00000") ' gstrPONUM = gstrPONUM & Format(intPO, "0000") gstrMODULE = gstrMODULE & " Line 24" frmPrint.txtMFlag = gstrFLAG gstrMODULE = gstrMODULE & " Line 26" frmPrint.txtSupplier = Left$(Field2Str(txtPODesc), 20) ' gstrCREW = Left$(Field2Str(txtPODesc), 20) gstrMODULE = gstrMODULE & gstrFLAG & " " frmPrint.txtDFlag = gstrTYPE gstrMODULE = gstrMODULE & " Line 30" If mintSUPPLIER = 99 Then frmPrint.txtPO = Field2Str2(moRSPO!ponum) ' gintPONUM = moRSPO!ponum Else frmPrint.txtPO = 0 ' gintPONUM = 0 End If gstrMODULE = gstrMODULE & " Line 35" frmPrint.Show 1 Exit Sub Error_EH: gstrMODULE = gstrMODULE & " Form LotInfo - Module ShowPrint" ' gstrMODULE = " Form LotInfo - Module ShowPrint" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdAddPO_Click() If mboolVERIFIED Then MsgBox "This Plan Has Been Checked and Verified - No Additional Material is allowed" End If Call POClear gconACTION = 0 cmdSavePO.Enabled = True cmdDelPO.Enabled = False cmdAddPO.Enabled = False cmdAddPOMat.Enabled = False cmdDelPOMat.Enabled = False cmdSavePOMat.Enabled = False cmdPrintPO.Enabled = False txtPOInvNo.Enabled = False txtPOMatDesc.Enabled = False txtPOQty.Enabled = False txtPOPrice.Enabled = False txtPODate.Enabled = True txtPODesc.Enabled = True txtIssueTo.Enabled = True txtPay.Enabled = True txtPayType.Enabled = True txtPONotes.Enabled = True cboPODFlag.Enabled = False cboPOMType.Enabled = False cmdFindPOMat.Enabled = False mboolAdding = True cboPOType.SetFocus End Sub Private Sub cmdLFlag_Click() moRS!y_FLG = "P" moRS!l_FLG = "P" moRS!s_FLG = "P" moRS!z_FLG = "P" Call cmdSaveLotInfo_Click cmdLFlag.Visible = False If FormFind() Then Call FormShow 'xxxxxxxxxxxxxxxxxx End If End Sub Private Sub cmdOrder_Click() gintORDER = 9 frmOrders.Show 1 End Sub Private Sub cmdPreOrderPrintY_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer Dim oRS As Recordset Dim strSELECT As String On Error GoTo Error_EH gboolPRINT = True gstrFLAG = "P" gstrTYPE = "Y" gstrPO = "L" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE po_num = '" & gstrPONUM & "'" ' and m_type = 'P'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "' and {tblLotMatrl.d_flag} = '" & oRS!d_flag & "'" '" ' and {tblORDERS.m_type} = 'P'" ' strSQL = "{tblORDERS.Po_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" ' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" crOrder.ReportFileName = App.Path & "\preorder.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset moRS!y_FLG = "P" moRS.Update cmdPreOrderPrintY.Enabled = False txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update gboolPRINT = False Call Form_Load SSTLotInfo.Tab = 1 ElseIf Len(gstrPONUM) > 0 Then moRS!y_FLG = "P" moRS.Update cmdPreOrderPrintY.Enabled = False Call Form_Load txtYardMemo = Field2Str(txtYardMemo) & " YARD PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update SSTLotInfo.Tab = 1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdPreOrderPrintY" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdPrint_Click() If cmdPrint.Caption = "Print Lath Order" Then Call cmdLathPrint_Click ElseIf cmdPrint.Caption = "Print Sand Order" Then Call cmdSandPrint_Click ElseIf cmdPrint.Caption = "Print Brown Order" Then Call cmdBrownPrint_Click ElseIf cmdPrint.Caption = "Print Scratch Order" Then Call cmdScratchPrint_Click ElseIf cmdPrint.Caption = "Print Texture Order" Then Call cmdTexturePrint_Click ElseIf cmdPrint.Caption = "Print Stone Order" Then Call cmdStonePrint_Click Else '***CHeck to see why an invoice had an extra zero 002 instead of 02 End If End Sub Private Sub cmdPrintCMU_Click() Dim strSQL As String On Error GoTo Error_EH gintPRINT = 1 frmReport.Show 1 Call LotChange(mstrPROJLOT, "Print CMU Pay Sheet") strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\cmupay.rpt" crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.Destination = crptToWindow ' crOrder.Destination = crptToPrinter crOrder.Destination = gintDEST crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset txtNotes = Field2Str(txtNotes) & " -- CMU PAYSHEET PRINTED " & Now() & " BY " & gstrLOGIN Call FormSave cmdPrintCMU.Enabled = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdPrintCMU_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdPrintPOPay_Click() Dim oRS As Recordset Dim strSQL As String On Error GoTo Error_EH gintCOPY = 1 gintPRINT = 1 frmReport.Show 1 If gintPRINT Then Call LotChange(mstrPROJLOT, "Print PO Pay Sheet") strSQL = "{tblPOrder.ponum} = " & mintPONUM crOrder.ReportFileName = App.Path & "\POpay.rpt" crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.Destination = crptToWindow ' crOrder.Destination = crptToPrinter crOrder.Destination = gintDEST crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 crOrder.Reset strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & mintPONUM Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic oRS!pay_flag = vbTrue oRS.Update cmdPrintPOPay.Enabled = False End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdPrintPOPay_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdPrintPO_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer Dim oRS As Recordset, intResponse As Integer Dim strSELECT As String mintBOOKMARK = lstPO.ListIndex On Error GoTo Error_EH mboolSTONE2 = False gboolPRINT = True If optPreOrder Then gstrFLAG = "P" Else gstrFLAG = "R" End If gintCOPY = 1 If optLath Then gstrTYPE = "Y" ElseIf optStucco Then gstrTYPE = "S" ElseIf optSand Then gstrTYPE = "A" ElseIf optPreOrder Then gstrTYPE = "Y" ElseIf optStone Then mboolSTONE2 = True gstrPO = "L" gstrFLAG = "V" gstrTYPE = "S" ElseIf optNone Then gstrTYPE = "" End If mintSUPPLIER = 99 Call ShowPrint mintSUPPLIER = 0 If gboolPRINT And mboolSTONE2 Then strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else moRS!VOrder = Field2Str(oRS!order_date) ' moRS!st_flg = vbTrue moRS.Update End If End If If gboolPRINT Then strSELECT = "SELECT * FROM tblPOrder WHERE PONum = " & lstPO.ItemData(lstPO.ListIndex) ' & " and p_flg <> 'P'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic If oRS!p_flg = "P" Then MsgBox "This PO has already been printed" Exit Sub End If If Not oRS.EOF Then crOrder.Reset strSQL = "{tblORDERS.po_num} = '" & gstrPONUM & "'" 'lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" ' strSQL = "{tblORDERS.po_num} = " & lstPO.ItemData(lstPO.ListIndex) ' & " and {tblORDERS.d_flag} = 'Y' and {tblORDERS.m_type} = 'P'" If gstrPO <> "L" Then crOrder.ReportFileName = App.Path & "\POMisc.rpt" Else Call POSetup crOrder.ReportFileName = App.Path & "\purchase.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset oRS!p_flg = "P" oRS.Update End If gboolPRINT = False If gstrPO = "L" Then intResponse = MsgBox("Do You Want To Print An Invoice", vbOKCancel, "Invoice Print") If intResponse = vbOK Then Call POInvoice End If End If Call Form_Load SSTLotInfo.Tab = 6 Else Call Form_Load SSTLotInfo.Tab = 6 End If lstPO.ListIndex = mintBOOKMARK mintBOOKMARK = 0 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdPrintPO_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub POSetup() Dim strDate As String, strSQL As String, intSUP As Integer Dim oRS As Recordset, oRSS As Recordset Dim strSELECT As String, strSql2 As String Dim dblOrder As Double strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else gstrPONUM = Field2Str(oRS!po_num) End If strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & gintPONUM ' & " and d_flag = 'S' and m_type = 'B'" ' or m_type = 'P')" ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If oRS.EOF Then Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF dblOrder = Field2Str2(oRS!qty) oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!o_qty = dblOrder oRSS!a_qty = dblOrder oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS.Update oRS.MoveNext Loop End If If oRS.State = adStateOpen Then oRS.Close End If If oRSS.State = adStateOpen Then oRSS.Close End If End Sub Private Sub cmdPreOrderPrintS_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer Dim oRS As Recordset Dim strSELECT As String On Error GoTo Error_EH gboolPRINT = True gstrFLAG = "P" gstrTYPE = "S" gstrPO = "L" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'P'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'P'" crOrder.ReportFileName = App.Path & "\preorder.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset moRS!s_FLG = "P" moRS.Update cmdPreOrderPrintS.Enabled = False gboolPRINT = False Call Form_Load txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update SSTLotInfo.Tab = 1 ElseIf Len(gstrPONUM) > 0 Then moRS!s_FLG = "P" moRS.Update cmdPreOrderPrintS.Enabled = False Call Form_Load txtYardMemo = Field2Str(txtYardMemo) & " SUPPLIER PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update SSTLotInfo.Tab = 1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PreOrderPrintS_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdPreOrderPrintPC_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer Dim oRS As Recordset Dim strSELECT As String On Error GoTo Error_EH gboolPRINT = True gstrFLAG = "Z" gstrTYPE = "S" gstrPO = "L" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE lot_id = " & gintLOTID & " and m_type = 'Z'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'Z'" crOrder.ReportFileName = App.Path & "\preorderPC.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset moRS!z_FLG = "P" moRS.Update cmdPreOrderPrintPC.Enabled = False gboolPRINT = False Call Form_Load txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update SSTLotInfo.Tab = 1 ElseIf Len(gstrPONUM) > 0 Then moRS!z_FLG = "P" moRS.Update cmdPreOrderPrintPC.Enabled = False Call Form_Load txtYardMemo = Field2Str(txtYardMemo) & " PRECAST PRE-ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update SSTLotInfo.Tab = 1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PreOrderPrintPC_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdPrintForm_Click() Me.PrintForm End Sub Private Sub cmdRePrintL_Click() Call RePrintLath cmdRePrintL.Visible = False Call FormShow End Sub Private Sub cmdSandPrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intTIME As Integer Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, sglSAND As Single Dim strSELECT As String, strSql2 As String, strSQL3 As String, strFIND As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer On Error GoTo Error_EH If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" strMSG = strMSG & Chr(10) & Chr(13) & Chr(10) & Chr(13) strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") ' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" If intResponse = vbYes Then Call cmdFindPlan_Click Call cmdCalc_Click cmdExit.Enabled = True End If ' Exit Sub End If If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If If Field2Str2(moRS!zone) = 0 Then MsgBox "Sand Delivery Zone Needs To Be Entered Before Printing", vbOKOnly, "No SandZone" Exit Sub End If If chkHoldOrders Then MsgBox "All Stucco/Sand Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" cmdExit.Enabled = True Exit Sub End If cmdExit.Enabled = False ' If moRS!Split Then If mboolSPLIT Then strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'A' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly intPERCENT = Field2Str2(oRS!SUMPercent) If intPERCENT = 0 Then boolFPRINT = True Else boolFPRINT = False End If ' gintPERCENT = Field2Str2(CInt(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent"))) gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) If gintPERCENT = 0 Then MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" Exit Sub End If If (intPERCENT + gintPERCENT) > 100 Then MsgBox "The Sum Of All Sand Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" cmdExit.Enabled = True Exit Sub End If Else gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True End If If (intPERCENT + gintPERCENT) = 100 Then boolCOMPLETE = True End If gboolPRINT = True gstrPO = "L" gstrFLAG = "A" gstrTYPE = "A" gintCOPY = 1 Call ShowPrint gstrMODULE = "After SHOWPRINT " If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE order_id = " & glngORDERID '& " and m_type = 'A'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly ' If moRS!Split Then If mboolSPLIT Then dblOrder = Int((((moRS!sand_ton) * gintPERCENT) / 100) + 0.99) strMSG = "Item -- Plaster Sand " & vbCrLf strMSG = strMSG & "Original Tons -- " & Field2Str2(moRS!sand_ton) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(moRS!ORD_NO) & vbCrLf strMSG = strMSG & "Balance Available -- " & Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) & vbCrLf If boolCOMPLETE Then dblOrder = Field2Str2(moRS!sand_ton) - Field2Str(moRS!ORD_NO) End If strMSG = strMSG & "Tons For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = moRS!ORD_NO + dblOrder If dblCheck > moRS!sand_ton Then dblOrder = moRS!sand_ton - moRS!ORD_NO ' Else End If moRS!ORD_NO = moRS!ORD_NO + dblOrder moRS.Update Else dblOrder = moRS!sand_ton End If moRS!Border = Field2Str(oRS!order_date) If boolCOMPLETE Then moRS!a_flg = vbTrue End If moRS.Update gstrMODULE = "After Update Delivery Date " ' glngORDERID = Field2Long(oRS!order_id) strSQL3 = "SELECT * FROM tblSZone" ' WHERE zone = 2" ' & Field2Integer(moRS!zone) Set oRSSS = New Recordset oRSSS.Open strSQL3, goConn, adOpenKeyset, adLockOptimistic If oRSSS.EOF Then Else oRSSS.MoveFirst strFIND = "zone = " & Field2Str2(moRS!zone) oRSSS.Find strFIND sglSAND = Format(Field2Str2(oRSSS!price), "#,#.00") End If strSql2 = "SELECT * FROM tblORDMatrl WHERE order_id = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic gstrMODULE = "Before Setup Materials " With oRSS .AddNew !order_id = glngORDERID !LOT_ID = gintLOTID !po_num = Field2Str(oRS!po_num) !d_flag = "S" !m_type = "A" !inv_no = "9999" !Desc = "ICBO RIVER PLASTER SAND" !x_flag = vbChecked !o_qty = dblOrder !a_qty = dblOrder !price = sglSAND .Update .AddNew !order_id = glngORDERID !LOT_ID = gintLOTID !po_num = Field2Str(oRS!po_num) !d_flag = "S" !m_type = "A" !inv_no = "9994" !Desc = "SPLIT CHARGE" !x_flag = vbChecked !o_qty = 0 !a_qty = 0 !price = 15 .Update .AddNew !order_id = glngORDERID !LOT_ID = gintLOTID !po_num = Field2Str(oRS!po_num) !d_flag = "S" !m_type = "A" !inv_no = "9993" !Desc = "MINIMUM ORDER CHARGE" !x_flag = vbChecked !o_qty = 0 !a_qty = 0 !price = 40 .Update End With crOrder.Reset strSQL = "{tblORDERS.Order_id} = " & glngORDERID ' & " and {tblORDERS.d_flag} = 'A' and {tblORDERS.m_type} = 'A'" If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\sand.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\sandM.rpt" End If crOrder.Formulas(1) = "Sand = " & dblOrder crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset gboolPRINT = False ' cmdSandPrint.Enabled = False txtYardMemo = Field2Str(txtYardMemo) & " SAND ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update Call Form_Load End If cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = gstrMODULE & "Form LotInfo - Module cmdSandPrint_Click" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub cmdSavePO_Click() Dim lngID As Long If Not IsDate(txtPODate) Then MsgBox "You Do Not Have A Valid PO Date", vbOKOnly, "Invalid Date" txtPODate.SetFocus Exit Sub End If If mboolVERIFIED Then MsgBox "This Plan Has Been Checked and Verified - Talk to TERESA", vbOKOnly, "Plan Verified" Call LotChange(mstrPROJLOT, "Chnge After Verified") End If If gconACTION = 2 Then Call LotChange(mstrPROJLOT, "Chnge PO Information") gconACTION = 0 End If ' If gconACTION = 5 Then ' Call LotChange(mstrPROJLOT, "Update After Lath") ' End If mintBOOKMARK = lstPO.ListIndex If mboolAdding Then If mintBOOKMARK = -1 Then mintBOOKMARK = 0 End If End If cmdAddPO.Enabled = True cmdAddPOMat.Enabled = True cmdSavePO.Enabled = False cmdSavePOMat.Enabled = False cmdDelPO.Enabled = True cmdDelPOMat.Enabled = True cmdPrintPO.Enabled = True cmdFindPOMat.Visible = False txtPODate.Enabled = True txtPODesc.Enabled = True txtIssueTo.Enabled = True txtPay.Enabled = True txtPayType.Enabled = True txtPONotes.Enabled = True lstLOOKUP.Visible = False Call POSave Call POLoad If mboolAdding Then mboolAdding = False lngID = FindMax("tblPOrder", "PONum") Call CBFindString(lstPO, CStr(lngID)) cmdAddPOMat.SetFocus mintBOOKMARK = lstPO.ListIndex End If lstPO.ListIndex = mintBOOKMARK mintBOOKMARK = 0 End Sub Private Sub cmdSavePOMat_Click() Dim intINVNO As String, lngID As Long If gconACTION = 2 Then Call LotChange(mstrPROJLOT, "Change PO Material") gconACTION = 0 End If ' If gconACTION = 5 Then ' Call LotChange(mstrPROJLOT, "Update After Lath") ' End If mintBOOKMARK = lstPOMaterial.ListIndex cmdAddPO.Enabled = True cmdAddPOMat.Enabled = True cmdSavePO.Enabled = False cmdSavePOMat.Enabled = False cmdDelPO.Enabled = True cmdDelPOMat.Enabled = True cmdPrintPO.Enabled = True cmdFindPOMat.Visible = False lstLOOKUP.Visible = False intINVNO = txtPOInvNo Call POMatSave Call POMatLoad txtPOInvNo.Enabled = False txtPOMatDesc.Enabled = False txtPOQty.Enabled = False txtPOPrice.Enabled = False cboPODFlag.Enabled = False cboPOMType.Enabled = False cmdFindPOMat.Enabled = False If mboolAdding Then mboolAdding = False Call CBFindString4(lstPOMaterial, CStr(intINVNO)) cmdAddPOMat.SetFocus mintBOOKMARK = 0 Exit Sub End If If lstPOMaterial.ListCount Then lstPOMaterial.ListIndex = CLng(mintBOOKMARK) ' lstPOMaterial.ListIndex = 5 mintBOOKMARK = 0 Else lstPOMaterial.ListIndex = -1 End If mintBOOKMARK = 0 End Sub Private Sub cmdScratchPrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer Dim oRS As Recordset, oRSS As Recordset Dim strSELECT As String, strSql2 As String, strSQLUP As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer Dim strORDERDATE As String On Error GoTo Error_EH If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" strMSG = strMSG & Chr(10) & Chr(13) strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") ' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" If intResponse = vbYes Then Call cmdFindPlan_Click Call cmdCalc_Click cmdExit.Enabled = True End If ' Exit Sub End If If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If cmdExit.Enabled = False If chkHoldOrders Then MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" cmdExit.Enabled = True Exit Sub End If gboolPRINT = True gintCOPY = 1 ' If moRS!Split Then If mboolSPLIT Then strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'S' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly intPERCENT = Field2Str2(oRS!SUMPercent) If intPERCENT = 0 Then boolFPRINT = True Else boolFPRINT = False End If gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) If gintPERCENT = 0 Then MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" Exit Sub End If If (intPERCENT + gintPERCENT) > 100 Then MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" cmdExit.Enabled = True Exit Sub End If Else gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True End If If (intPERCENT + gintPERCENT) = 100 Then boolCOMPLETE = True End If gstrPO = "L" gstrFLAG = "S" gstrTYPE = "S" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else strORDERDATE = Field2Str(oRS!order_date) ' glngORDERID = Field2Integer(oRS!order_id) gstrPONUM = Field2Str(oRS!po_num) ' If moRS!Split Then strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" ' or m_type = 'P')" ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If oRS.EOF Then MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" Call Form_Load cmdExit.Enabled = True Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF strMSG = oRS!Desc If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then ' If moRS!Split Then If mboolSPLIT Then dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf strMSG = strMSG & "Qty For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = oRS!o_qty + dblOrder If dblCheck > oRS!qty Then dblOrder = oRS!qty - oRS!o_qty ' Else End If oRS!o_qty = oRS!o_qty + dblOrder oRS.Update Else dblOrder = oRS!qty End If oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!x_flag = vbChecked oRSS!o_qty = dblOrder oRSS!a_qty = dblOrder oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS.Update End If oRS.MoveNext Loop End If ' End If moRS!TORDER = strORDERDATE ' moRS!forder = Field2Str(oRS!order_date) If boolCOMPLETE Then moRS!c_flg = vbTrue End If moRS.Update End If If oRS.State = adStateOpen Then oRS.Close End If If oRSS.State = adStateOpen Then oRSS.Close End If crOrder.Reset strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" ' strSQL = "{tblORDERS.lot_id} = " & gintLOTID & " and {tblORDERS.d_flag} = 'S' and {tblORDERS.m_type} = 'S'" crOrder.ReportFileName = App.Path & "\NewScratch.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% SCRATCH ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'S'" goConn.Execute strSQLUP gboolPRINT = False ' cmdScratchPrint.Enabled = False Call Form_Load End If cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdScratchPrint_Click" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub PrintActual() Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset Dim strSELECT As String, strOPTION As String, intCOUNT As Integer Dim start On Error GoTo Error_EH strSELECT = "DELETE * FROM tblReport" goConn.Execute strSELECT strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly strOPTION = "SELECT * FROM tblReport" Set oRSSS = New Recordset oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic oRSSS.AddNew intCOUNT = 0 Do Until oRS.EOF strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) Set oRSS = New Recordset oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSS.EOF Then intYARDS = intYARDS + Field2Integer(oRSS!Yardage) intCOUNT = intCOUNT + 1 If intCOUNT = 1 Then oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 2 Then oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 3 Then oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 4 Then oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 5 Then oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 6 Then oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 7 Then oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 8 Then oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 9 Then oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 10 Then oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If End If oRS.MoveNext Loop oRSSS!LOT_ID = gintLOTID oRSSS!optyds = intYARDS oRSSS.Update ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID start = Timer ' Set start time. Do While Timer < start + 5 ' DoEvents ' Yield to other processes. Loop If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\actual.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\actualM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintActual" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintActualJG() Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset, intYN As Integer Dim strSELECT As String, strOPTION As String, intCOUNT As Integer Dim start On Error GoTo Error_EH strSELECT = "DELETE * FROM tblReport" goConn.Execute strSELECT strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly strOPTION = "SELECT * FROM tblReport" Set oRSSS = New Recordset oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic oRSSS.AddNew intCOUNT = 0 Do Until oRS.EOF strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) Set oRSS = New Recordset oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSS.EOF Then intYARDS = intYARDS + Field2Integer(oRSS!Yardage) intCOUNT = intCOUNT + 1 If intCOUNT = 1 Then oRSSS!desc1 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 2 Then oRSSS!desc2 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 3 Then oRSSS!desc3 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 4 Then oRSSS!desc4 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 5 Then oRSSS!desc5 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 6 Then oRSSS!desc6 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 7 Then oRSSS!desc7 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 8 Then oRSSS!desc8 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 9 Then oRSSS!desc9 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If If intCOUNT = 10 Then oRSSS!desc10 = Field2Str(oRSS!Yardage) & vbTab & Field2Str(oRSS!Desc) End If End If oRS.MoveNext Loop oRSSS!LOT_ID = gintLOTID oRSSS!optyds = intYARDS oRSSS.Update ' strSQL = "{tblLOTINFO.lot_id} = " & gintLOTID strSQL = "{tblReport.lot_id} = " & gintLOTID '& " and {tblLOTINFO.lot_id} = " & gintLOTID start = Timer ' Set start time. Do While Timer < start + 5 ' DoEvents ' Yield to other processes. Loop If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\actualJG.rpt" ' ElseIf moRSProj!cocode = 1 Then ' crOrder.ReportFileName = App.Path & "\actualM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow ' crOrder.Destination = crptToPrinter intYN = MsgBox("Do You Want To Print To The Printer", vbYesNo + vbDefaultButton2, "Printer or Screen") If intYN = vbYes Then crOrder.Destination = crptToPrinter Else crOrder.Destination = crptToWindow End If crOrder.Action = 1 crOrder.Reset Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintActualJG" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdShowChange_Click() frmLotChLog.Show 1 End Sub Private Sub cmdStonePrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer Dim oRS As Recordset, oRSS As Recordset Dim strSELECT As String, strSql2 As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, boolNOSTONE As Boolean On Error GoTo Error_EH boolNOSTONE = False If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If cmdExit.Enabled = False If chkHoldOrders Then MsgBox "All Stone Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" cmdExit.Enabled = True Exit Sub End If gintCOPY = 1 gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True If (intPERCENT + gintPERCENT) = 100 Then boolCOMPLETE = True End If gboolPRINT = True gstrPO = "L" gstrFLAG = "V" gstrTYPE = "S" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE Order_id = " & glngORDERID ' & " and m_type = 'T'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else moRS!VOrder = Field2Str(oRS!order_date) If boolCOMPLETE Then moRS!st_flg = vbTrue End If moRS.Update End If strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'V'" ' or m_type = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If oRS.EOF Then boolNOSTONE = True crOrder.Reset strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" crOrder.ReportFileName = App.Path & "\Stone2.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 crOrder.Reset ' MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" ' Call Form_Load ' cmdExit.Enabled = True ' Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF If Field2Str2(oRS!qty) > Field2Str2(oRS!o_qty) Then ' If moRS!Split Then If mboolSPLIT Then dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf strMSG = strMSG & "Qty For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = oRS!o_qty + dblOrder If dblCheck > oRS!qty Then dblOrder = oRS!qty - oRS!o_qty ' Else End If oRS!o_qty = oRS!o_qty + dblOrder oRS.Update Else dblOrder = oRS!qty End If oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!o_qty = dblOrder oRSS!a_qty = dblOrder oRSS!x_flag = vbChecked oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS.Update End If oRS.MoveNext Loop End If If oRS.State = adStateOpen Then oRS.Close End If ' If oRSS.State = adStateOpen Then ' oRSS.Close ' End If If Not boolNOSTONE Then crOrder.Reset strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" crOrder.ReportFileName = App.Path & "\Stone.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 End If crOrder.Reset MsgBox "Insert 1 Sheet of Purple/Lavendar Paper for the Stone Pay Sheets and then Press Enter", vbOKOnly, "Insert Paper" gintCOPY = 1 strSQL = "{tblLotInfo.lot_id} = " & gintLOTID ' & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" crOrder.ReportFileName = App.Path & "\StonePay.rpt" crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 If boolCOMPLETE Then Call PrintStoneInv '******* Print Invoice crOrder.Reset End If txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% STONE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update gboolPRINT = False Call Form_Load End If ' cmdStonePrint.Enabled = False cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdStonePrint_Click" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub cmdStuccoPay_Click() Dim strPAY As String strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" Set moRSPay = New Recordset moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic Call LotChange(mstrPROJLOT, "RePrint Stucco Pay") If chkSynthetic = vbChecked And moRSProj!stype <> "T" Then MsgBox "**SYNTHETIC** Insert 2 Sheets of Paper for the Stucco Pay Sheets and then Press Enter", vbOKOnly, "InsertPaper" ' MsgBox "Make Sure GOLD and RED Paper Is In The Printer and then Press Enter", vbOKOnly, "Insert Gold & Red Paper" gintCOPY = 1 Call PrintStuccoSyn crOrder.Reset gintCOPY = 1 ElseIf moRSProj!stype <> "T" Then gintCOPY = 1 If mboolST_ADJ Then Call PrintStuccoPay2 Else Call PrintStuccoPay End If Else gintCOPY = 1 Call PrintStuccoThree End If cmdStuccoPay.Visible = False End Sub Private Sub cmdSuperRpt_Click() Dim strDate As String, strSQL As String, intSUP As Integer, intYARDS As Integer Dim oRS As Recordset, oRSS As Recordset, oRSSS As Recordset Dim strSELECT As String, strOPTION As String, intCOUNT As Integer On Error GoTo Error_EH cmdExit.Enabled = False If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If Not IsDate(moRS!calcdate) Then moRS!calcdate = 0 End If If (moRS!lorder) = #12/31/2030# Then ' If Not IsDate(moRS!SOrder) Then If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" Exit Sub End If End If strSELECT = "DELETE * FROM tblReport" goConn.Execute strSELECT gintCOPY = 1 strSELECT = "SELECT * FROM tblLOption WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly strOPTION = "SELECT * FROM tblReport" Set oRSSS = New Recordset oRSSS.Open strOPTION, goConn, adOpenKeyset, adLockOptimistic oRSSS.AddNew intCOUNT = 0 Do Until oRS.EOF strSQL = "SELECT optid, yardage, desc FROM tblPOption where optid = " & Field2Str(oRS!Opt_ID) Set oRSS = New Recordset oRSS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSS.EOF Then intYARDS = intYARDS + Field2Integer(oRSS!Yardage) intCOUNT = intCOUNT + 1 If intCOUNT = 1 Then oRSSS!desc1 = Field2Str(oRSS!Desc) End If If intCOUNT = 2 Then oRSSS!desc2 = Field2Str(oRSS!Desc) End If If intCOUNT = 3 Then oRSSS!desc3 = Field2Str(oRSS!Desc) End If If intCOUNT = 4 Then oRSSS!desc4 = Field2Str(oRSS!Desc) End If If intCOUNT = 5 Then oRSSS!desc5 = Field2Str(oRSS!Desc) End If If intCOUNT = 6 Then oRSSS!desc6 = Field2Str(oRSS!Desc) End If If intCOUNT = 7 Then oRSSS!desc7 = Field2Str(oRSS!Desc) End If If intCOUNT = 8 Then oRSSS!desc8 = Field2Str(oRSS!Desc) End If If intCOUNT = 9 Then oRSSS!desc9 = Field2Str(oRSS!Desc) End If If intCOUNT = 10 Then oRSSS!desc10 = Field2Str(oRSS!Desc) End If End If oRS.MoveNext Loop oRSSS!LOT_ID = gintLOTID oRSSS!optyds = intYARDS oRSSS.Update gintPRINT = 9 frmReport.Show 1 If gintPRINT = 0 Then cmdExit.Enabled = True Exit Sub End If strSQL = "{tblReport.lot_id} = " & gintLOTID & " and {tblLOTINFO.lot_id} = " & gintLOTID crOrder.ReportFileName = App.Path & "\super.rpt" crOrder.ReplaceSelectionFormula (strSQL) ' crOrder.Destination = crptToWindow ' crOrder.Destination = crptToPrinter crOrder.Destination = gintDEST crOrder.CopiesToPrinter = gintCOPY crOrder.Action = 1 cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdSuperRpt_Click" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub cmdTexturePrint_Click() Dim strDate As String, strSQL As String, intSUP As Integer Dim oRS As Recordset, oRSS As Recordset Dim strSELECT As String, strSql2 As String, strSQLUP As String Dim dblCheck As Double, dblOrder As Double, boolCOMPLETE As Boolean Dim boolFPRINT As Boolean, intPERCENT As Integer, strMSG As String, intResponse As Integer Dim strORDERDATE As String On Error GoTo Error_EH If Not IsDate(moRSPlan!Update) Then moRSPlan!Update = 0 End If If Not IsDate(moRS!calcdate) Then moRS!calcdate = 1 End If If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then strMSG = "This Plan Has Been Updated - It Is Recommended That You ReImport & ReCalculate" strMSG = strMSG & Chr(10) & Chr(13) strMSG = strMSG & "Do You Want To ReImport & ReCalculate?" intResponse = MsgBox(strMSG, vbYesNo, "Recalculate Recommended") ' MsgBox "This Plan Has Been Updated - You Need To ReImport & ReCalculate", vbOKOnly, "Recalculate Required" If intResponse = vbYes Then Call cmdFindPlan_Click Call cmdCalc_Click cmdExit.Enabled = True End If ' Exit Sub End If If moRSProj!plien_req And Not moRSProj!plien_done Then MsgBox "This Lot Requires A PreLien Which Is Not Done - No Orders Allowed", vbOKOnly, "No Lath Allowed" Exit Sub End If cmdExit.Enabled = False If chkHoldOrders Then MsgBox "All Stucco Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Orders On Hold" cmdExit.Enabled = True Exit Sub End If ' If chkSynthetic Then ' MsgBox "Synthetic Finish - Texture Orders Are On Hold - Correct Problem and Then Print", vbOKOnly, "Texture Orders On Hold" ' cmdExit.Enabled = True ' Exit Sub ' End If gintCOPY = 1 ' If moRS!Split Then If mboolSPLIT Then strSELECT = "SELECT SUM(percentage) as SUMPercent FROM tblOrders where M_Type = 'T' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly intPERCENT = Field2Str2(oRS!SUMPercent) If intPERCENT = 0 Then boolFPRINT = True Else boolFPRINT = False End If gintPERCENT = Field2Str2(InputBox("Enter The Percent To Order (100 = 100%)", "Enter Percent")) If gintPERCENT = 0 Then MsgBox "Must Enter A Value Greater Than Zero", vbOKOnly, "Zero Value" Exit Sub End If If (intPERCENT + gintPERCENT) > 100 Then MsgBox "The Sum Of All Lath Orders Is Greater Than 100% -- ReEnter", vbOKOnly, "Invalid Percentage" cmdExit.Enabled = True Exit Sub End If Else gintPERCENT = 100 boolCOMPLETE = True boolFPRINT = True End If If (intPERCENT + gintPERCENT) = 100 Then boolCOMPLETE = True End If gboolPRINT = True gstrPO = "L" gstrFLAG = "T" gstrTYPE = "S" Call ShowPrint If gboolPRINT Then strSELECT = "SELECT * FROM tblOrders WHERE Order_Id = " & glngORDERID ' & " and m_type = 'B'" Set oRS = New Recordset oRS.Open strSELECT, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then Else strORDERDATE = Field2Str(oRS!order_date) ' glngORDERID = Field2Integer(oRS!order_id) gstrPONUM = Field2Str(oRS!po_num) ' If moRS!Split Then strSQL = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" ' or m_type = 'P')" ' strSQL = "{tblLotMatrl.lot_id} = " & gintLOTID & " and {tblLotMatrl.d_flag} = 'S' and ({tblLotMatrl.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If oRS.EOF Then MsgBox "There Are Not Items To Print", vbOKOnly, "No Print" Call Form_Load cmdExit.Enabled = True Exit Sub Else strSql2 = "SELECT * FROM tblOrdMatrl WHERE Order_ID = 1" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF strMSG = oRS!Desc If Field2Double(oRS!qty) > Field2Double(oRS!o_qty) Then ' If moRS!Split Then If mboolSPLIT Then dblOrder = Int((((oRS!qty) * gintPERCENT) / 100) + 0.99) strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & vbCrLf ' strMSG = "Item -- " & Trim$(Field2Str(oRS!Desc)) & Chr(10) & Chr(13) strMSG = strMSG & "Original Qty -- " & Field2Str2(oRS!qty) & vbCrLf strMSG = strMSG & "Already Shipped -- " & Field2Str(oRS!o_qty) & vbCrLf strMSG = strMSG & "Qty For This Order -- " & dblOrder dblOrder = CInt(InputBox(strMSG, "Order Quantity", dblOrder)) dblCheck = oRS!o_qty + dblOrder If dblCheck > oRS!qty Then dblOrder = oRS!qty - oRS!o_qty ' Else End If oRS!o_qty = oRS!o_qty + dblOrder oRS.Update Else dblOrder = oRS!qty End If oRSS.AddNew oRSS!order_id = glngORDERID oRSS!Desc = oRS!Desc oRSS!LOT_ID = oRS!LOT_ID oRSS!po_num = gstrPONUM oRSS!d_flag = oRS!d_flag oRSS!m_type = oRS!m_type oRSS!x_flag = vbChecked oRSS!o_qty = dblOrder oRSS!a_qty = dblOrder oRSS!price = oRS!price oRSS!inv_no = oRS!inv_no oRSS.Update End If oRS.MoveNext Loop End If ' End If moRS!SORDER = strORDERDATE ' moRS!forder = Field2Str(oRS!order_date) If boolCOMPLETE Then moRS!t_flg = vbTrue End If moRS.Update End If If oRS.State = adStateOpen Then oRS.Close End If If oRSS.State = adStateOpen Then oRSS.Close End If crOrder.Reset strSQL = "{tblORDERS.PO_Num} = '" & gstrPONUM & "'" ' and {tblORDERS.d_flag} = 'S' and ({tblORDERS.m_type} = 'L' or {tblLOTMATRL.m_type} = 'P')" If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\NewTexture.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\NewTextureM.rpt" End If crOrder.ReplaceSelectionFormula (strSQL) crOrder.CopiesToPrinter = gintCOPY crOrder.Destination = crptToPrinter crOrder.Action = 1 txtYardMemo = Field2Str(txtYardMemo) & " " & gintPERCENT & "% TEXTURE ORDER PRINTED - " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update gboolPRINT = False strSQLUP = "UPDATE tblLotMatrl SET PRNT_Flag = true WHERE lot_id = " & gintLOTID & " and d_flag = 'S' and m_type = 'T'" goConn.Execute strSQLUP Call Form_Load End If cmdExit.Enabled = True Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdTexturePrint_Click" Call ErrorHandler2 gstrMODULE = "" cmdExit.Enabled = True Exit Sub End Sub Private Sub cmdUpCMU_Click() Dim intCMU As Integer intCMU = InputBox("Enter The Correct CMU Yardage", "CMU Yardage Update") If intCMU > 0 Then moRS!CMU = intCMU moRS.Update Call FormShow End If End Sub Private Sub Form_Activate() Dim intResponse As Integer, lngLOTID As Long, lngPROJID As Long Dim strSQL As String On Error GoTo Error_EH mboolADD = False mboolBAD = False ' mboolENTER = False If gintLOTID = 0 Then intResponse = MsgBox("No Lot Information, do you wish to add one?", vbYesNo + vbQuestion, "Add Lot Information") If intResponse = vbYes Then txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc strSQL = "SELECT * FROM tblLotInfo WHERE Lot_id = 1" Set moRS = New Recordset moRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Call cmdAddLot_Click If mboolBAD Then Unload Me End If Else Unload Me End If ''' Else ''' lngLOTID = gintLOTID ''' lngPROJID = gintPROJID ''' Call GetPlanInfo ''' strSQL = "SELECT * FROM tblLotInfo WHERE Lot_ID = " & gintLOTID ''' Set moRS = New Recordset ''' moRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic ''' If moRS.EOF Then ' lngLOTID = gintLOTID ''' End If ' If mboolPLANUP Then ''' If Date2Field(moRSPlan!Update) > Date2Field(moRS!calcdate) Then ''' MsgBox "Plan Information Has Been Updated - Plan will be ReLoaded and Lot Will Exit", vbOKOnly, "Must Update" ''' Call cmdFindPlan_Click ''' gintLOTID = lngLOTID ''' gintPROJID = lngPROJID ' Call cmdCalc_Click ''' Call cmdSaveLotInfo_Click ''' Call cmdExit_Click ''' End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module Form_Activate" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim ShiftDown, AltDown, CtrlDown Dim oRS As Recordset, strSQL As String, strCOST As String, strINVNO As String Dim strPAY As String, intYN As Integer, strMSG As String, lngOPTID As Long Dim strSQLST As String, oRSST As Recordset, strSQLPST As String, oRSPST As Recordset ' E Print Stone Order ' L Allow Reprint of Lath Pay Sheets ' A Allow update of Address and Owner information on after Lot has been completed ' X Update Paint Square Footage ' T Print Paint Pay Sheets if not already done. ' S Reprint Stucco Pay Sheets ' M Resets the PO Flag to true ' W Update cost on the highlighted item in the Materials List ' Y Allow the reprint of the Lath Yard Order ' I Allow Lath Material Order to be reprinted ' F Turn On The Lath material ' R Turn on the RePrint Lath Button ' H ReSet The PreOrder info & Turn On The Print PreOrder Button ' D Turn on the Reprint PreorderY button ' G Print the Actual Report for Jesse ' N Turn on the Save Lot Info BUtton ' U Set flag for Stucco Cert ' Q Mark a lot option for Stone ' A Print a Stucco Invoice If Shift = 4 Then Exit Sub End If ShiftDown = (Shift And vbShiftMask) > 0 AltDown = (Shift And vbAltMask) > 0 CtrlDown = (Shift And vbCtrlMask) > 0 If KeyCode = vbKeyE And gbytSECURITY < 3 Then ' Allow Print of Stone If chkStone And moRS!st_flg Then strMSG = "Either Stone Has Already Been Printed OR " & vbCrLf strMSG = strMSG & "There Is No Stone Required On This Lot" MsgBox strMSG, vbOKOnly, "No Stone" ' Exit Sub Else cmdPrint.Caption = "Print Stone Order" cmdPrint.Enabled = True End If Exit Sub End If If KeyCode = vbKeyL And gbytSECURITY < 3 Then ' Allow RePrint of Lath Pay Sheets If CtrlDown And SSTLotInfo.Tab = 1 Then cmdLathPay.Visible = True End If Exit Sub End If If KeyCode = vbKeyA And gbytSECURITY < 3 Then ' Allow RePrint of Lath Pay Sheets If CtrlDown And SSTLotInfo.Tab = 6 Then Call POInvoice ' cmdLathPay.Visible = True End If Exit Sub End If '' If KeyCode = vbKeyQ And gbytSECURITY < 7 Then ' Allow setting up the Stone in options - Orders or less '' If CtrlDown And SSTLotInfo.Tab = 3 Then '' If lstLOptions.ListCount = 0 Then '' MsgBox "No Lot Options - Stone Update Not Allowed", vbOKOnly, "Select A Stone Option" '' Exit Sub '' End If '' If lstLOptions.ListIndex = -1 Then '' MsgBox "No Lot Options Selected", vbOKOnly, "Select A Stone Option" '' Exit Sub '' End If '' lngOPTID = Val(lstLOptions. '' strSQLST = "SELECT * FROM tblLOption WHERE OPT_ID = " & lngOPTID '' Set oRSST = New Recordset '' oRSST.Open strSQLST, goConn, adOpenForwardOnly, adLockOptimistic '' oRSST!ostone = True '' oRSST.Update '' End If '' Exit Sub '' End If If KeyCode = vbKeyA And gbytSECURITY < 8 Then ' Allow Update of Address, and Owner information If CtrlDown And SSTLotInfo.Tab = 0 Then txtAddress.Enabled = True txtOwner.Enabled = True cmdSaveLotInfo.Enabled = True End If Exit Sub End If If KeyCode = vbKeyX Then ' Update the Paint Square Footage If CtrlDown Then Call PaintFix End If Exit Sub End If If KeyCode = vbKeyU Then ' Make the Flag that Shows Stucco Cert Done - True If CtrlDown Then moRS!SCert = vbTrue moRS.Update End If Exit Sub End If If KeyCode = vbKeyT And gbytSECURITY <= 6 Then ' Print Paint Pay Sheets ' If KeyCode = vbKeyT And gbytSECURITY <= 3 Then ' Print Paint Pay Sheets If CtrlDown Then If Not mboolPAINT Then MsgBox "This Lot Does Not Have Paint - PaySheets Will Not Be Printed", vbOKOnly, "Not A Paint Lot" Exit Sub End If ' ElseIf moRS!PNT_Print Then ' ElseIf moRS!PNT_FLG Or moRS!PNT_Print Then ' MsgBox "Paint Pay Has Already Been Printed", vbOKOnly, "Print Denied" ' Exit Sub ' Else intYN = MsgBox("Are You Sure You Want To Print Paint PaySheets?", vbYesNo, "Print Paint PaySheets") If intYN = vbYes Then strPAY = "SELECT * FROM tblPAYSHEET WHERE PAYID = 1" Set moRSPay = New Recordset moRSPay.Open strPAY, goConn, adOpenKeyset, adLockOptimistic frmPaintPrtJobs.Show 1 ' Call LotChange(mstrPROJLOT, "Print Paint Pay") ' Call PrintPaintPay ' **** need to watch this End If End If ' End If Exit Sub End If If KeyCode = vbKeyS And gbytSECURITY < 3 Then ' Allow REprint of Stucco Pay SHeets If CtrlDown And SSTLotInfo.Tab = 1 Then mboolRPSTUCCO = True cmdStuccoPay.Visible = True End If Exit Sub End If If KeyCode = vbKeyM And gbytSECURITY < 3 Then ' Display key combinations. If CtrlDown And SSTLotInfo.Tab = 6 Then moRSPO!POFlag = vbTrue moRSPO.Update End If Exit Sub End If If KeyCode = vbKeyW And gbytSECURITY < 3 Then ' HotKey to allow entering Cost On HighLited Iterm If CtrlDown And SSTLotInfo.Tab = 2 Then lstLMaterial.col = 4 strINVNO = lstLMaterial.ColText strSQL = "SELECT * FROM tblLotMatrl WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic strCOST = InputBox("Enter The Cost Amt. You Want To Fix", "Enter Cost", strCOST) oRS!price = Field2Str2(strCOST) oRS.Update End If Exit Sub End If If KeyCode = vbKeyY And gbytSECURITY < 3 Then ' Display key combinations. If CtrlDown And SSTLotInfo.Tab = 1 Then cmdIssue.Visible = True End If Exit Sub End If If KeyCode = vbKeyI And gbytSECURITY < 3 Then ' Display key combinations. If CtrlDown And SSTLotInfo.Tab = 1 Then Call PrintLathMat gintCOPY = 1 End If Exit Sub End If If KeyCode = vbKeyF And gbytSECURITY < 3 Then ' Display key combinations. If CtrlDown And SSTLotInfo.Tab = 1 Then cmdLFlag.Visible = True End If Exit Sub End If If KeyCode = vbKeyR And gbytSECURITY < 3 Then ' Turn on the Reprint Lath Button If CtrlDown And SSTLotInfo.Tab = 1 Then cmdRePrintL.Visible = True End If Exit Sub End If If KeyCode = vbKeyH And gbytSECURITY < 3 Then ' ReSet The PreOrder info & Turn On The Print PreOrder Button If CtrlDown And SSTLotInfo.Tab = 1 Then Call RePrintPreCast cmdPreOrderPrintPC.Enabled = True 'eVisible = True End If Exit Sub End If If KeyCode = vbKeyD And gbytSECURITY < 3 Then ' Display key combinations. If CtrlDown And SSTLotInfo.Tab = 1 Then cmdPreOrderPrintY.Enabled = True End If Exit Sub End If If KeyCode = vbKeyG And (gbytSECURITY < 7 Or gstrLOGIN = "TYF2" Or gstrLOGIN = "TLB" Or gstrLOGIN = "TB") Then ' Print Special Report for Jesse ' Dim intYN As Integer If CtrlDown And SSTLotInfo.Tab = 1 Then intYN = MsgBox("Do You Want To Print Jesse's Special Report?", vbYesNo, "Print Jesse's Report") If intYN = vbNo Then Exit Sub End If Call PrintActualJG End If Exit Sub End If ' If KeyCode = vbKeyN And (gbytSECURITY < 3 Or gbytSECURITY = 6 Or gbytSECURITY = 7) Then ' Display key combinations. If KeyCode = vbKeyN And (gbytSECURITY < 8) Then ' Display key combinations. If CtrlDown Then cmdSaveLotInfo.Enabled = True cmdSaveLotInfo.SetFocus End If Exit Sub End If If Field2Str(moRS!l_FLG) <> "P" Then If Not cmdSaveLotInfo.Enabled Then Call DataHasChanged End If End If End Sub Private Sub DataHasChanged() cmdSaveLotInfo.Enabled = True cmdAddLot.Enabled = False End Sub Private Sub RePrintPreCast() 'Allows a PreCast order to be reprinted Dim strSQL As String 'This resets all flags to allow the correct reprint of informatin Dim oRS As Recordset 'but will keep a copy of the original orders printed Call LotChange(mstrPROJLOT, "Allow RePrint PreCast") moRS!z_FLG = Null moRS.Update moRSMemo!notes = Field2Str(moRSMemo!notes) & " - PRECAST PRINTING RESET ON " & Now() & " BY " & gstrLOGIN moRSMemo.Update strSQL = "SELECT * FROM tblOrders WHERE m_type = 'Z' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRS!m_type = "H" oRS!d_flag = "X" oRS!ar_trans = vbChecked oRS!ap_trans = vbChecked oRS.Update oRS.MoveNext Loop ' Call LotRePrinted End Sub 'Private Sub cmdFindInv_Click() 'Dim oRS As Recordset 'Dim strSQL As String, lngFind As Long, strTYPE As String ' On Error GoTo Error_EH ' strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtLMInvNo.Text & "'" ' Set oRS = New Recordset ' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly ' If oRS.RecordCount > 0 Then ' With oRS ' txtLMInvNo = Field2Integer(!inv_no) ' txtLMDesc = Field2Str(!Desc) ' txtLMLength = Field2Integer(!calc_amt) ' If !d_flag = "S" Then ' cboLMDFlag.Text = "Supplier" ' Else ' cboLMDFlag.Text = "Yard" ' End If ' strTYPE = Field2Str(!m_type) ' Call FindType(cboPOMType, strTYPE) ' If !calc_flag = "M" Then ' cboLMMetal.Text = "Metal" ' Else ' cboLMMetal.Text = "None" ' End If ' End With ' txtLMQty.SetFocus ' Else ' Call cmdInventory_Click ' lngFind = Field2Long(txtLMInvNo) ' Call ListFindItem2(lstInventory, lngFind) ' End If ' oRS.Close ' Exit Sub 'Error_EH: ' gstrMODULE = "Form LotInfo - Module cmdFindInv_Click" ' Call ErrorHandler2 ' gstrMODULE = "" ' Exit Sub 'End Sub Private Sub cmdFindPlan_Click() Dim strSTARTDATE As String, lngPOS As Long Dim oRS As Recordset, oRSSS As Recordset Dim strSQL As String, lngFind As Long, strTEST As String Dim strSql2 As String On Error GoTo Error_EH If gconACTION = 5 Then Call LotChange(mstrPROJLOT, "Update After Lath") gconACTION = 0 End If strSQL = "SELECT * from tblPlans WHERE Mod_elv = '" & txtModel.Text & "' and proj_id = " & gintPROJID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If (mstrPLNELEV = "HOLD" And txtModel <> "HOLD") And Not mboolPLNCHANGE Then mboolPLNCHANGE = True strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") lngPOS = InStr(1, strSTARTDATE, "/", 1) If Not IsDate(strSTARTDATE) Then If lngPOS = 0 Then If Len(strSTARTDATE) > 0 Then strSTARTDATE = Format(strSTARTDATE, "00/00/####") If Not IsDate(strSTARTDATE) Then MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" ' Call cmdExit_Click mboolBAD = True Exit Sub End If mstrSTARTDATE = strSTARTDATE Else MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" mboolBAD = True Exit Sub ' Call cmdExit_Click End If Else MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" ' Call cmdExit_Click mboolBAD = True Exit Sub End If Else mstrSTARTDATE = strSTARTDATE End If End If If Not mboolAdding Then txtYardMemo = Field2Str(txtYardMemo) & " - PLAN IMPORTED ON " & Now() & " BY " & gstrLOGIN & " " moRSMemo!notes = UCase(Field2Str(txtYardMemo)) moRSMemo.Update End If If oRS.RecordCount > 0 Then With oRS ' txtTtlYdge = Field2Integer(!TO_TTLYDS) 'This May have to be changed to be Mat_YDS + Openings txtTtlYdge = Field2Integer(!mat_yds) ' Changed back per Jesse 07/09/2018 txtModel = Field2Str(!Mod_Elv) txtCMUYdge = Field2Integer(!CMUYDS) If !HLNotes = True Then mboolHLNotes = True Else mboolHLNotes = False End If ' chkHLNotes = Field2CheckBox(!HLNotes) txtNotes = Field2Str(!notes) ' txtFoamAdj = Field2Integer(!f_adj) mstrFoamAdj = Field2Integer(!f_adj) ' txtLaborAdj = Field2Integer(!l_adj) mstrLaborAdj = Field2Integer(!l_adj) mstrWireAdj = Field2Integer(!w_adj) txtFin2 = Field2Integer(!fin2) txt28Foam = Field2Integer(!foam) txtOPEN = Field2Integer(!opening) chkStone = Field2CheckBox(!stone) ' chkPaint = Field2CheckBox(!Paint) ' txtStone = Field2Str2(!ST_SQFT) mstrStone = Field2Str2(!ST_SQFT) lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) ' & "'" lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) ' & "'" lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) ' & "'" mintST_ADJ = Field2Integer(!st_adj) If mintST_ADJ > 0 Then mboolST_ADJ = True Else mboolST_ADJ = False End If txtStoneBill = Field2Str2(!st_bill) moRS!Scaf6 = Field2Str2(!Scaf6) moRS!scaf10 = Field2Str2(!scaf10) moRS!twostory = !twostory moRS!UPDTPLAN = Now Call FindTexture2(Field2Str(!texture), strTYPE) txtFinish = strTYPE If !texture = "SB" Then chkSynthetic = vbChecked lblSynthetic.Visible = True End If If moRSProj!stype = "S" Then txtOneKote.Text = "Superwall" ElseIf moRSProj!stype = "M" Then txtOneKote.Text = "Magna Wall" ElseIf moRSProj!stype = "T" Then txtOneKote.Text = "Three Coat" ElseIf moRSProj!stype = "N" Then txtOneKote.Text = "Synthetic" ElseIf moRSProj!stype = "B" Then txtOneKote.Text = "Synthetic over 1 Kote" ElseIf moRSProj!stype = "W" Then txtOneKote.Text = "Western 1 Kote" End If If Not !Firsttime Then !Firsttime = vbChecked chkFirst = vbChecked .Update End If gintESTID = !est_id If Not mboolAdding Then moRS!est_id = gintESTID moRS!import = Date moRS!imuser = gstrLOGIN End If Call FieldsSave End With ' oRS.Update 'clear materials and get correct for model 'update materials and yardage for options Else Call PlanLoad cmdFindPlan.Visible = False If lstPlans.ListCount = 0 Then MsgBox "There are no plans for this Project/Subdivision - Exit and Enter/Import Plans", , "No Plans" cmdSaveLotInfo.Enabled = False gstrFLAG = "P" Unload Me Exit Sub Else lstPlans.ListIndex = 0 lstPlans.SetFocus oRS.Close Exit Sub End If End If oRS.Close If mboolAdding Then Call ElevLoad Call PlanFind Call FormShow Call MatLoad Call POptLoad Call LOptLoad Call OptMatLoad Call OrderLoad Call POLoad mboolAdding = False Else Call ElevLoad Call DelLotMat Call PlanMatLoad Call ReloadOptMat Call MatLoad Call POptLoad Call LOptLoad Call OptMatLoad Call OrderLoad Call cmdSaveLotInfo_Click Call cmdExit_Click End If Exit Sub Error_EH: Call ErrorHandler(oRSSS.ActiveConnection) ' gstrMODULE = "Form LotInfo - Module cmdFindPlan_Click" ' Call ErrorHandler2 ' gstrMODULE = "" Exit Sub End Sub Private Sub DelLotMat() Dim strSQL As String strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and ch_flag = " & vbUnchecked goConn.Execute strSQL End Sub Private Sub ReloadOptMat() Dim oRS As Recordset Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT * FROM tblLOption where lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic Do Until oRS.EOF mintOPTID = Field2Long(oRS!Opt_ID) Call UpLotInfo Call UpLMat oRS.MoveNext Loop Exit Sub Error_EH: ' Call ErrorHandler(oRSS.ActiveConnection) gstrMODULE = "Form LotInfo - Module ReloadOptMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{TAB}" KeyAscii = 0 End If End Sub Private Sub cmdAddLot_Click() Dim strSTARTDATE As String, lngPOS As Long mboolADD = True strSTARTDATE = InputBox("Enter the Builder's Start Date (MMDDYYYY)", "Start Date") lngPOS = InStr(1, strSTARTDATE, "/", 1) If Not IsDate(strSTARTDATE) Then If lngPOS = 0 Then If Len(strSTARTDATE) > 0 Then strSTARTDATE = Format(strSTARTDATE, "00/00/####") If Not IsDate(strSTARTDATE) Then MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" ' Call cmdExit_Click mboolBAD = True Exit Sub End If mstrSTARTDATE = strSTARTDATE Else MsgBox "The Date You Entered is not Valid Now Exiting Add Lot" mboolBAD = True Exit Sub ' Call cmdExit_Click End If Else MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - Exiting" ' Call cmdExit_Click mboolBAD = True Exit Sub End If Else mstrSTARTDATE = strSTARTDATE End If mboolAdding = True gconACTION = 0 gintLOTID = 0 txtJC.Enabled = True cmdCalc.Enabled = False cmdDelLot.Enabled = False cmdAddLot.Enabled = False cmdAddMatrl.Enabled = False cmdDelMatrl.Enabled = False cmdSaveMatrl.Enabled = False cmdOptAdd.Enabled = False cmdOptDel.Enabled = False txtLotNo.Enabled = True cmdSaveLotInfo.Enabled = True cmdFindPlan.Enabled = True cmdOrders.Enabled = True Call LotNew Call FormClear Call MatClear If Not mboolADD Then txtAddress.SetFocus End If End Sub Private Sub cmdAddMatrl_Click() ' lstLMaterial.ListIndex = -1 lstLMaterial.Enabled = False ' moRSMat.Update ' moRSMat.Close Call MatClear cmdAddMatrl.Enabled = False cmdDelMatrl.Enabled = False cmdSaveMatrl.Enabled = True cmdInventory.Visible = True lblMatInst.Visible = True txtLMDesc.SetFocus mboolAdding = True End Sub Private Sub cmdDelMatrl_Click() Dim strYN As String strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") If strYN = vbNo Then Exit Sub End If gconACTION = 3 mintBOOKMARK = lstLMaterial.ListIndex moRSMat.Delete Call LotChange(mstrPROJLOT, "Delete Material") Call MatLoad If lstLMaterial.ListCount Then If lstLMaterial.ListCount > mintBOOKMARK Then lstLMaterial.ListIndex = mintBOOKMARK mintBOOKMARK = 0 Else lstLMaterial.ListIndex = mintBOOKMARK - 1 End If End If gconACTION = 0 cmdAddMatrl.Enabled = True cmdDelMatrl.Enabled = False cmdSaveMatrl.Enabled = False End Sub Private Sub cmdInventory_Click() lstInventory.Visible = True Call InventoryLoad End Sub Private Sub cmdOptAdd_Click() Dim strSQL As String Dim strSql2 As String, oRS As Recordset On Error GoTo Error_EH If moRSLOpt.State = adStateClosed Then strSQL = "SELECT * FROM tblLOption" ' strSQL = "SELECT * FROM tblLOption where opt_id = 1" Set moRSLOpt = New Recordset moRSLOpt.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic End If If moRSLOpt.EOF Then End If strSql2 = "SELECT * FROM tblPOption where optid = " & lstPOptions.ItemData(lstPOptions.ListIndex) Set oRS = New Recordset oRS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly If lstPOptions.ListIndex <> -1 Then moRSLOpt.AddNew moRSLOpt!LOT_ID = gintLOTID moRSLOpt!Opt_ID = lstPOptions.ItemData(lstPOptions.ListIndex) mintOPTID = lstPOptions.ItemData(lstPOptions.ListIndex) moRSLOpt!C_USER = gstrLOGIN If oRS!ostone Then moRSLOpt!ostone = vbChecked ' moRSLOpt.Update End If moRSLOpt.Update lstPOptions.Enabled = True Call UpLotInfo Call UpLMat Call LOptLoad Call FieldsSave Call MatSave Call MatLoad lstPOptions.ListIndex = -1 cmdOptAdd.Enabled = False End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module cmdOptAdd_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdOptDel_Click() Dim strSQL As String gconACTION = 3 gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) Call LotChange(mstrPROJLOT, "Delete Lot Option") Call UpdateLotInfo Call UpdateLMat Call MatSave Call MatLoad Call FieldsSave strSQL = "DELETE * FROM tblLOption WHERE Lot_ID = " & gintLOTID & " and Opt_id = " & lstLOptions.ItemData(lstLOptions.ListIndex) goConn.Execute strSQL Call LOptLoad cmdOptDel.Enabled = False gconACTION = 0 End Sub Private Sub UpLMat() Dim oRS As Recordset Dim oRSS As Recordset Dim oRSSS As Recordset Dim strSQL As String, strSql2 As String, intOpt As Integer Dim intLoop As Integer, strSQL3 As String On Error GoTo Error_EH strSQL = "SELECT Opt_ID, Lot_id " strSQL = strSQL & "FROM tblLOption " strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) Set oRS = New Recordset oRS.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic oRS.MoveLast oRS.MoveFirst intOpt = oRS.RecordCount For intLoop = 1 To intOpt strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic Do Until oRSS.EOF strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID Set oRSSS = New Recordset oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic If oRSSS.RecordCount = 0 Then oRSSS.AddNew oRSSS!LOT_ID = gintLOTID oRSSS!inv_no = Field2Str(oRSS!inv_no) oRSSS!Desc = Field2Str(oRSS!Desc) oRSSS!d_flag = Field2Str(oRSS!d_flag) oRSSS!m_type = Field2Str(oRSS!m_type) oRSSS!calc_flag = Field2Str(oRSS!calc_flag) oRSSS!calc_amt = Field2Integer(oRSS!calc_amt) oRSSS!qty = Field2Str(oRSS!qty) oRSSS.Update ' oRSSS.Close Else oRSSS!qty = (oRSSS!qty + oRSS!qty) oRSSS.Update ' oRSSS.Close End If If moRSProj!FHA Then If Field2Str(oRSSS!inv_no) = 1570 Then ' mintTake138 = Field2Str(oRS!qty) moRS!jmb138 = Field2Str(oRSSS!qty) txtTake138 = moRS!jmb138 ' txtTake138 = mintTake138 moRS.Update End If Else If Field2Str(oRSSS!inv_no) = 1130 Then ' mintTake138 = Field2Str(oRS!qty) moRS!jmb138 = Field2Str(oRSSS!qty) txtTake138 = moRS!jmb138 ' txtTake138 = mintTake138 moRS.Update End If End If oRSSS.Close oRSS.MoveNext Loop Next intLoop oRS.Close oRSS.Close Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module UpLMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub UpdateLMat() Dim oRS As Recordset Dim oRSS As Recordset Dim oRSSS As Recordset Dim strSQL As String, strSql2 As String, intOpt As Integer Dim intLoop As Integer, strSQL3 As String On Error GoTo Error_EH strSQL = "SELECT Opt_ID, Lot_id " strSQL = strSQL & "FROM tblLOption " strSQL = strSQL & "WHERE Lot_id = " & gintLOTID & " and opt_id = " & gintOPTID Set oRS = New Recordset oRS.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic oRS.MoveLast oRS.MoveFirst intOpt = oRS.RecordCount For intLoop = 1 To intOpt strSql2 = "SELECT inv_no, desc, D_Flag, M_Type, Calc_Flag, Calc_Amt, Qty FROM tblPOMatrl where Optid = " & gintOPTID Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic Do Until oRSS.EOF strSQL3 = "SELECT * from tblLotMatrl WHERE Inv_no = '" & oRSS!inv_no & "' and Lot_id = " & gintLOTID Set oRSSS = New Recordset oRSSS.Open strSQL3, goConn, adOpenForwardOnly, adLockOptimistic If oRSSS.RecordCount = 0 Then Else oRSSS!qty = (oRSSS!qty - oRSS!qty) If oRSSS!qty <= 0 Then oRSSS.Delete Else oRSSS.Update End If End If If moRSProj!FHA Then If Field2Str(oRSSS!inv_no) = 1570 Then ' mintTake138 = Field2Str(oRS!qty) moRS!jmb138 = Field2Str(oRSSS!qty) txtTake138 = moRS!jmb138 ' txtTake138 = mintTake138 moRS.Update End If Else If Field2Str(oRSSS!inv_no) = 1130 Then ' mintTake138 = Field2Str(oRS!qty) moRS!jmb138 = Field2Str(oRSSS!qty) txtTake138 = moRS!jmb138 ' txtTake138 = mintTake138 moRS.Update End If End If oRSSS.Close oRSS.MoveNext Loop Next intLoop oRS.Close oRSS.Close Exit Sub Error_EH: If Err = -2147217885 Then Resume Next Else gstrMODULE = "Form LotInfo - Module UpdateLMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End If End Sub Private Sub UpdateLotInfo() Dim oRS As Recordset, oRSE As Recordset Dim oRSS As Recordset, oRSSE As Recordset, strSQLE2 As String Dim strSQL As String, strSql2 As String, strSQLE As String On Error GoTo Error_EH strSQL = "SELECT * " strSQL = strSQL & "FROM tblPOption " strSQL = strSQL & "WHERE Optid = " & lstLOptions.ItemData(lstLOptions.ListIndex) Set oRS = New Recordset oRS.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic moRS!sq_yd = moRS!sq_yd - oRS!Yardage txtTtlYdge = moRS!sq_yd moRS!fin2 = moRS!fin2 - oRS!fin2 txtFin2 = moRS!fin2 moRS!f_adj = moRS!f_adj - oRS!f_adj lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" mstrFoamAdj = Field2Str2(moRS!f_adj) ' txtFoamAdj = moRS!f_adj If oRS!texture <> "" Then strSQL = "SELECT Texture " strSQL = strSQL & "FROM tblPlans " strSQL = strSQL & "WHERE Proj_id = " & gintPROJID & " and Mod_Elv = '" & txtModel.Text & "'" Set oRSS = New Recordset oRSS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic moRS!texture = Field2Str(oRSS!texture) Call FindTexture2(moRS!texture, strTYPE) txtFinish = strTYPE If moRS!texture <> "SB" Then chkSynthetic = vbUnchecked lblSynthetic.Visible = False End If End If If oRS!FileName <> "" Then strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic strSQLE2 = "SELECT * FROM tblElevation WHERE Primary and est_id = " & gintESTID Set oRSSE = New Recordset oRSSE.Open strSQLE2, goConn, adOpenKeyset, adLockOptimistic If Not oRSE.EOF Then oRSE!FileName = oRSSE!FileName oRSE.Update oRSE.Close End If oRSSE.Close End If If oRS!ostone Then ' moRS!stone = vbUnchecked chkStone = vbUnchecked moRS!ST_SQFT = moRS!ST_SQFT - oRS!OSt_SqFt txtStoneBill = Val(txtStoneBill) - Field2Double(oRS!Amt) lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(moRS!ST_SQFT) lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(moRS!PNT_SQFT) ' txtStone = moRS!ST_SQFT mstrStone = Field2Str2(moRS!ST_SQFT) moRS!ostone = vbUnchecked End If If oRS.State = adStateOpen Then oRS.Close End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module UpdateLotInfo" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub UpLotInfo() Dim oRS As Recordset, oRSE As Recordset Dim strSQL As String, strMSG As String, strSQLE As String On Error GoTo Error_EH strSQL = "SELECT * " strSQL = strSQL & "FROM tblPOption " strSQL = strSQL & "WHERE Optid = " & mintOPTID 'lstPOptions.ItemData(lstPOptions.ListIndex) Set oRS = New Recordset oRS.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If oRS.RecordCount = 0 Then strMSG = "Option " & mintOPTID & " was not found and was not updated - Call Darv" MsgBox strMSG, vbCritical + vbOKOnly, "Deleted Option" Exit Sub End If moRS!sq_yd = moRS!sq_yd + oRS!Yardage txtTtlYdge = moRS!sq_yd moRS!fin2 = moRS!fin2 + oRS!fin2 txtFin2 = moRS!fin2 moRS!f_adj = moRS!f_adj + oRS!f_adj lblFoamAdj.Caption = "Foam Adj. Yardage: " & "'" & Field2Str2(moRS!f_adj) & "'" mstrFoamAdj = Field2Str2(moRS!f_adj) ' txtFoamAdj = moRS!f_adj If oRS!texture <> "" Then moRS!texture = Field2Str(oRS!texture) Call FindTexture2(moRS!texture, strTYPE) txtFinish = strTYPE If moRS!texture = "SB" Then chkSynthetic = vbChecked lblSynthetic.Visible = True End If End If If oRS!FileName <> "" Then strSQLE = "SELECT * FROM tblLotElev WHERE Primary and lot_id = " & gintLOTID Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenKeyset, adLockOptimistic If Not oRSE.EOF Then oRSE!FileName = oRS!FileName oRSE.Update oRSE.Close End If End If If oRS!ostone Then ' moRS!stone = vbChecked chkStone = vbChecked moRS!ST_SQFT = moRS!ST_SQFT + oRS!OSt_SqFt ' = Val(txtStoneBill) + Field2Double(oRS!amt) txtStoneBill = Val(txtStoneBill) + Field2Double(oRS!Amt) lblStoneSqFt.Caption = "Stone Square Ft.: " & "'" & Field2Str2(moRS!ST_SQFT) & "'" ' txtStone = moRS!ST_SQFT mstrStone = Field2Str2(moRS!ST_SQFT) moRS!ostone = vbChecked End If If oRS.State = adStateOpen Then oRS.Close End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module UpLotInfo" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim intResponse As Integer, strMSG As String On Error GoTo Error_EH If mboolCRITICAL Then Exit Sub End If If gstrFLAG <> "D" Then If gstrFLAG <> "P" Then If cmdSaveLotInfo.Enabled Then strMSG = "Data Has Been Changed" strMSG = strMSG & Chr(13) & Chr(10) strMSG = strMSG & "Save Changes ?" intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) Select Case intResponse Case vbYes Call FormSave Case vbNo Case vbCancel Cancel = True Exit Sub End Select End If End If End If If moRS.State = adStateOpen Then moRS.Close End If If moRSMat.State = adStateOpen Then moRSMat.Close End If If moRSOptMat.State = adStateOpen Then moRSOptMat.Close End If If moRSLOpt.State = adStateOpen Then moRSLOpt.Close End If If moRSPOpt.State = adStateOpen Then moRSPOpt.Close End If If moRSProj.State = adStateOpen Then moRSProj.Close End If If moRSPlan.State = adStateOpen Then moRSPlan.Close End If ' gintLOTID = 0 'This May Need To Be Turned Back On if LotID is wrong Exit Sub Error_EH: If Err = 3219 Then Resume Next End If End Sub Private Sub cmdSaveLotInfo_Click() If gconACTION = 4 Then Call LotChange(mstrPROJLOT, "Change Lot Information") gconACTION = 0 End If If gconACTION = 5 Then Call LotChange(mstrPROJLOT, "Update After Lath") gconACTION = 0 End If Call FieldsSave Call MatSave txtLotNo.Enabled = False cmdSaveLotInfo.Enabled = False If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then cmdAddLot.Enabled = False Else cmdAddLot.Enabled = True End If cmdAddMatrl.Enabled = True cmdSaveMatrl.Enabled = False cmdDelMatrl.Enabled = False txtJC.Enabled = False If gbytSECURITY = 1 Then cmdDelLot.Enabled = True End If txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) If Field2Str(moRS!l_FLG) <> "P" Then If txtSuperBB = 0 And txtSuper12 = 0 Then cmdCalc.Enabled = False Else cmdCalc.Enabled = True End If End If End Sub Private Sub cmdSaveMatrl_Click() If gconACTION = 6 Then Call LotChange2(mstrPROJLOT, "Change Lot Material", txtLMDesc, mstrBEGQTY, mstrENDQTY) ' Call LotChange(mstrPROJLOT, "Change Lot Material") gconACTION = 0 ' End If ElseIf gconACTION = 5 Then Call LotChange(mstrPROJLOT, "Update After Lath") gconACTION = 0 End If On Error GoTo Error_EH mintBOOKMARK = lstLMaterial.ListIndex ' Store the controls to the recordset Call MatSave Call MatLoad ' mintINVNO = Field2Str2(moRSMat!inv_no) If mboolAdding Then mboolAdding = False Call ListFindItemS5(lstLMaterial, (mintINVNO)) ', 4) mintBOOKMARK = lstLMaterial.ListIndex End If cmdInventory.Visible = False lblMatInst.Visible = False If gconACTION <> 5 Then If moRS!l_FLG <> "P" Then cmdAddMatrl.Enabled = True cmdDelMatrl.Enabled = False cmdSaveMatrl.Enabled = False lstLMaterial.Enabled = True Else cmdDelMatrl.Enabled = False cmdSaveMatrl.Enabled = False lstLMaterial.Enabled = True End If End If lstLMaterial.ListIndex = mintBOOKMARK mintBOOKMARK = 0 lstLMaterial.SetFocus Exit Sub Error_EH: Call ErrorHandler(moRSMat.ActiveConnection) Exit Sub End Sub Private Sub cmdOrders_Click() Call OrderLoad End Sub Private Sub Form_Load() Dim strSQL As String, oRS As Recordset, strSQLL As String, lngINVID As Long Dim strSQLS As String, oRSST As Recordset Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 Set moRS = New Recordset Set moRSProj = New Recordset Set moRSMat = New Recordset Set moRSPOpt = New Recordset Set moRSLOpt = New Recordset Set moRSOptMat = New Recordset Set moRSPlan = New Recordset Set moRSPO = New Recordset Set moRSPOMAT = New Recordset Set moRSMemo = New Recordset mboolSTONE3 = False mboolST_ADJ = False mintST_ADJ = 0 '*** FIX On Error GoTo Error_EH mboolHLNotes = False mboolPLNCHANGE = False If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then cmdAddLot.Enabled = False Else cmdAddLot.Enabled = True End If ' strSQLS = "SELECT * FROM tblP" 'Need to set a flag that tells when a lot is marked for stone but has not stone setup in the billing grid strSQL = "SELECT * FROM tblSYSINFO" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic gdteUPDATE = oRS!LastUP - 20 strSQLL = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLL, goConn, adOpenForwardOnly, adLockOptimistic lngINVID = Field2Str2(moRSInvINFO!ARINVOICE_TRANS_ID) mlngINVID = lngINVID lngINVID = lngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = lngINVID moRSInvINFO.Update mboolFRMLOAD = False mboolSPLIT = False mboolStone = False gstrFLAG = "" gstrPO = "L" ' gbytSECURITY = 1 SSTLotInfo.Tab = 0 mboolCRITICAL = False If gbytSECURITY = 1 Then cmdDelLot.Enabled = True End If ' if Call MTypeLoad(cboPOMType) Call MTypeLoad(cboLMType) Call MTypeLoad(cboLOMType) Call ProjLoad If mboolCOMM Then txtSuperBB.Enabled = True Else txtSuperBB.Enabled = False End If If FormFind() Then Call PlanFind If mboolCRITICAL Then Unload Me Exit Sub End If If mboolStone Then Call SetStone End If Call FormShow Call MatLoad Call POptLoad Call LOptLoad Call OptMatLoad Call OrderLoad Call POLoad ' Call POMatLoad End If If gintLOTID <> 0 Then If IsNull(moRS!y_FLG) Then cmdPreOrderPrintY.Enabled = True End If If IsNull(moRS!s_FLG) Then cmdPreOrderPrintS.Enabled = True End If If IsNull(moRS!z_FLG) Then cmdPreOrderPrintPC.Enabled = True End If ' If IsNull(moRS!l_flg) Then ' cmdLathPrint.Enabled = True ' ElseIf moRS!l_flg = "P" And Not moRS!a_flg Then ' cmdSandPrint.Enabled = True ' ElseIf moRS!a_flg And moRSProj!stype = "T" And Not moRS!c_flg Then ' cmdScratchPrint.Enabled = True ' ElseIf moRS!a_flg And Not moRS!b_flg Then ' cmdBrownPrint.Enabled = True ' ElseIf moRS!b_flg And Not moRS!t_flg Then ' cmdTexturePrint.Enabled = True ' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then ' cmdStonePrint.Enabled = True ' End If If moRS!t_flg And chkStone And Not moRS!st_flg Then cmdPrint.Caption = "Print Stone Order" cmdPrint.Enabled = True ' cmdStonePrint.Enabled = True ElseIf IsNull(moRS!l_FLG) Then cmdPrint.Caption = "Print Lath Order" cmdPrint.Enabled = True ' cmdLathPrint.Enabled = True ElseIf moRS!l_FLG = "P" And Not moRS!a_flg Then cmdPrint.Caption = "Print Sand Order" cmdPrint.Enabled = True ' cmdSandPrint.Enabled = True ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then ' ElseIf moRS!a_flg And Not moRS!b_flg Then cmdPrint.Caption = "Print Scratch Order" ' cmdPrint.Caption = "Print Brown Order" cmdPrint.Enabled = True ' cmdScratchPrint.Enabled = True ElseIf moRS!a_flg And Not moRS!b_flg Then ' ElseIf moRS!a_flg And Not moRS!c_flg And moRSProj!stype = "T" Then cmdPrint.Caption = "Print Brown Order" ' cmdPrint.Caption = "Print Scratch Order" cmdPrint.Enabled = True ' cmdBrownPrint.Enabled = True ElseIf moRS!b_flg And Not moRS!t_flg Then cmdPrint.Caption = "Print Texture Order" cmdPrint.Enabled = True ' cmdTexturePrint.Enabled = True ' ElseIf moRS!t_flg And chkStone And Not moRS!st_flg Then ' cmdPrint.Caption = "Print Stone Order" ' cmdPrint.Enabled = True ' cmdStonePrint.Enabled = True Else cmdPrint.Caption = "All Orders Printed" cmdPrint.Enabled = False End If txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) If Field2Str(moRS!l_FLG) <> "P" Then If txtSuper12 = 0 And txtSuperBB = 0 Then cmdCalc.Enabled = False Else cmdCalc.Enabled = True End If End If End If If gbytSECURITY <= 6 Then cmdEdit.Visible = True cmdEdit.Enabled = True End If If chkHoldOrders Then cmdSaveLotInfo.Enabled = False If gbytSECURITY > 3 Then chkHoldOrders.Enabled = False chkHoldOrders.BackColor = &H80FFFF Else chkHoldOrders.Enabled = True chkHoldOrders.BackColor = &H80FFFF End If Else chkHoldOrders.Enabled = True End If ' If chkSplit Then ' cmdSaveLotInfo.Enabled = False ' If gbytSECURITY > 3 Then ' chkSplit.Enabled = False ' chkSplit.BackColor = &H80FFFF ' Else ' chkSplit.Enabled = True ' chkSplit.BackColor = &H80FFFF ' End If ' Else ' chkSplit.Enabled = True ' End If If chkHoldPO Then cmdSaveLotInfo.Enabled = False If gbytSECURITY > 3 Then chkHoldPO.Enabled = False chkHoldPO.BackColor = &H80FFFF Else chkHoldPO.Enabled = True chkHoldPO.BackColor = &H80FFFF End If Else chkHoldPO.Enabled = True End If If chkSynthetic Then cmdSaveLotInfo.Enabled = False If gbytSECURITY > 3 Then chkSynthetic.Enabled = False chkSynthetic.BackColor = &H80FFFF Else chkSynthetic.Enabled = True chkSynthetic.BackColor = &H80FFFF End If End If If chkStone Then cmdSaveLotInfo.Enabled = False If chkOthers Then lblStone.Caption = "Stone By Others" chkOthers.BackColor = &HFF Else lblStone.Caption = "Stone Veneer" End If If gbytSECURITY > 3 Then chkStone.Enabled = False chkStone.BackColor = &H80FFFF Else chkStone.Enabled = True chkStone.BackColor = &H80FFFF End If End If ' If gbytSECURITY = 6 And lstPO.ListCount > 4 Then If gbytSECURITY = 6 And lstPO.ListCount > moRSProj!pomax Then cmdAddPO.Enabled = False cmdSavePO.Enabled = False cmdDelPO.Enabled = False cmdPrintPO.Enabled = False cmdPrintForm.Enabled = False cmdDelPOMat.Enabled = False cmdSavePOMat.Enabled = False cmdAddPOMat.Enabled = False End If mboolFRMLOAD = True ' Call ListChanges ' cmdExit.Enabled = True Exit Sub Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module Form_Load" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub ProjLoad() Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT * FROM tblProject where proj_id = " & gintPROJID moRSProj.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If moRSProj!stone Then mboolStone = True End If mstrWIRE = Field2Str(moRSProj!wire) If moRSProj!twodates Then mbool2Dates = True End If If moRSProj!certpr Then mboolCERTIFIED = True Else mboolCERTIFIED = False End If If moRSProj!Apt Then mboolCOMM = True Else mboolCOMM = False End If gintCOCODE = Field2Str2(moRSProj!cocode) Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module ProjLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PlanLoad() Dim oRS As Recordset Dim strSQL As String, strTEST As String On Error GoTo Error_EH strSQL = "SELECT mod_elv, Est_id from tblplans WHERE proj_id = " & gintPROJID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstPlans.Clear Do Until oRS.EOF With lstPlans .AddItem Field2Str(oRS!Mod_Elv) .ItemData(.NewIndex) = oRS!est_id End With lstPlans.Visible = True lblPlan.Visible = True oRS.MoveNext Loop oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PlanLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShow() On Error GoTo Error_EH mboolSHOW = True gintLOTID = moRS!LOT_ID txtProject = Trim$(moRSProj!Proj_Code) & " " & moRSProj!Proj_Desc If moRSProj!bb Then lblBB.Caption = "This House Uses Blackboard" Else lblBB.Caption = "This House Uses R-Guard" End If If moRSProj!zmetal Then lblZMetal.Visible = True Else lblZMetal.Visible = False End If With moRS lblSZone = Field2Str2(!zone) lblSandShip = Field2Str2(!ORD_NO) txtTake138 = Field2Integer(!jmb138) txtCalc138 = Field2Integer(!jmb138) txtTtlYdge = Field2Integer(!sq_yd) txtAddress = Field2Str(!address) txtOwner = Field2Str(!Owner) txtModel = Field2Str(!model) txtCMUYdge = Field2Integer(!CMU) txtNotes = Field2Str(!notes) If !HLNotes And Len(txtNotes) > 0 Then txtNotes.ForeColor = &HFF& txtNotes.BackColor = &H80FFFF Else txtNotes.ForeColor = &H80000008 txtNotes.BackColor = &H80000005 End If txtSuperNotes = Field2Str(!supernotes) txtLotNotes = Field2Str(!lotnotes) lblFoamAdj.Caption = "Foam Adj. Yardage: " & Field2Str2(!f_adj) lblLaborAdj.Caption = "Labor Adj. Yardage: " & Field2Str2(!l_adj) ' & "'" lblWireAdj.Caption = "Wire Adj. Yardage: " & Field2Str2(!w_adj) '& "'" lblStoneSqFt.Caption = "Stone Square Ft.: " & Field2Str2(!ST_SQFT) ' & "'" lblPaintSqFt.Caption = "Paint Square Ft.: " & Field2Str(!PNT_SQFT) '& "'" mstrFoamAdj = Field2Integer(!f_adj) mstrLaborAdj = Field2Integer(!l_adj) mstrStone = Field2Str2(!ST_SQFT) ' txtFoamAdj = Field2Integer(!f_adj) ' txtLaborAdj = Field2Integer(!l_adj) mstrWireAdj = Field2Integer(!w_adj) ' txtStone = Field2Str2(!ST_SQFT) mintST_ADJ = Field2Integer(!st_adj) If mintST_ADJ > 0 Then mboolST_ADJ = True Else mboolST_ADJ = False End If txtFin2 = Field2Integer(!fin2) txtLotNo = Field2Str(!lot_no) txt28Foam = Field2Integer(!foam) txtOPEN = Field2Str2(!opening) chkFirst = Field2CheckBox(!Firsttime) txtMetal = Field2Double(!METAL) txtSand = Field2Integer(!sand_ton) txtSuperBB = Field2Integer(!SUP_BB) txtSuper12 = Field2Integer(!SUP_FD12) txtSuper1383 = Field2Integer(!SUP_138) If CInt(txtSuper1383) < 0 Then txtSuper1383 = 0 End If ' txtSuper1383 = 0 txtSuper783 = Field2Integer(!SUP_783) txtSuper78 = Field2Integer(!SUP_78) txtSuper38 = Field2Integer(!SUP_38) txtSuperRL = Field2Integer(!SUP_RL) txtSuperML = Field2Integer(!SUP_ML) txtSuperDW = Field2Integer(!SUP_DW) txtSuperSP = Field2Integer(!SUP_SP) txtLathO = IIf(Field2Str(!lorder) = "12:00:00 AM", "", Field2Str(!lorder)) If txtLathO = "" Then txtLathO = "12/31/2030" End If txtSandO = IIf(Field2Str(!Border) = "12:00:00 AM", "", Field2Str(!Border)) txtScratchO = IIf(Field2Str(!TORDER) = "12:00:00 AM", "", Field2Str(!TORDER)) txtBrownO = IIf(Field2Str(!forder) = "12:00:00 AM", "", Field2Str(!forder)) txtTextureO = IIf(Field2Str(!SORDER) = "12:00:00 AM", "", Field2Str(!SORDER)) txtLathBill = IIf(Field2Str(!VOrder) = "12:00:00 AM", "", Field2Str(!VOrder)) txtStoneBill = Field2Str2(!st_bill) txtJC = Field2Str(!jobcost) chkHoldOrders = Field2CheckBox(!hold_stucco) chkHoldPO = Field2CheckBox(!hold_po) chkPaint = Field2CheckBox(!PNT_FLG) chkSynthetic = Field2CheckBox(!syn_flag) chkStone = Field2CheckBox(!stone) chkOthers = Field2CheckBox(!otstone) chkNoPay = Field2CheckBox(!nopayissue) Call FindTexture2(Field2Str(!texture), strTYPE) txtFinish = strTYPE If !texture = "SB" Then chkSynthetic = vbChecked lblSynthetic.Visible = True End If End With If moRSProj!stype = "S" Then txtOneKote.Text = "Superwall" ElseIf moRSProj!stype = "M" Then txtOneKote.Text = "Magna Wall" ElseIf moRSProj!stype = "T" Then txtOneKote.Text = "Three Coat" ElseIf moRSProj!stype = "C" Then txtOneKote.Text = "Synthetic" ElseIf moRSProj!stype = "B" Then txtOneKote.Text = "Synthetic over 1 Kote" ElseIf moRSProj!stype = "W" Then txtOneKote.Text = "Western 1 Kote" ElseIf moRSProj!stype = "N" Then txtOneKote.Text = "San Man" End If If moRS!l_FLG = "P" Then txtTtlYdge.Enabled = False txtCMUYdge.Enabled = False ' txtStone.Enabled = False txtLotNo.Enabled = False cmdAddMatrl.Enabled = False cmdDelMatrl.Enabled = False cmdSaveMatrl.Enabled = False cmdOptDel.Enabled = False cmdDelLot.Enabled = False cmdSaveLotInfo.Enabled = False cmdFindPlan.Enabled = False cmdOrders.Enabled = False cmdCalc.Enabled = False ' txtYardMemo.Enabled = False txtYardMemo.Enabled = True txtYardMemo.Locked = True cmdUpCMU.Enabled = False cmdPrintCMU.Enabled = False Call LotPrinted End If If moRS!Firsttime Then lblFirst.Visible = True End If If chkPaint = vbChecked Then mboolPAINT = True Else mboolPAINT = False End If mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShow" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub LotPrinted() txtAddress.Enabled = False txtOwner.Enabled = False txtModel.Enabled = False txtNotes.Enabled = False ' txtFoamAdj.Enabled = False ' txtLaborAdj.Enabled = False ' txtWireAdj.Enabled = False ' txtFin2.Enabled = False txt28Foam.Enabled = False txtSuperBB.Enabled = False txtSuper12.Enabled = False txtSuper783.Enabled = False txtSuper78.Enabled = False txtSuper38.Enabled = False txtSuper1383.Enabled = False txtSuperRL.Enabled = False txtSuperML.Enabled = False txtSuperDW.Enabled = False txtSuperSP.Enabled = False lblLathPrint.Visible = True cmdPreOrderPrintY.Enabled = False cmdPreOrderPrintS.Enabled = False End Sub Private Sub LotRePrinted() txtAddress.Enabled = True txtOwner.Enabled = True txtModel.Enabled = True txtNotes.Enabled = True ' txtFoamAdj.Enabled = True ' txtLaborAdj.Enabled = True ' txtWireAdj.Enabled = True ' txtFin2.Enabled = True txt28Foam.Enabled = True ' txtSuperBB.Enabled = True If mboolCOMM Then txtSuperBB.Enabled = True Else txtSuperBB.Enabled = False End If txtSuper12.Enabled = True txtSuper783.Enabled = True txtSuper78.Enabled = True txtSuper38.Enabled = True ' txtSuper1383.Enabled = True ' txtSuperRL.Enabled = True ' txtSuperML.Enabled = True ' txtSuperDW.Enabled = True txtSuperSP.Enabled = True lblLathPrint.Visible = False cmdPreOrderPrintY.Enabled = True cmdPreOrderPrintS.Enabled = True cmdPrint.Enabled = True End Sub Private Sub LotNew() txtAddress.Enabled = True txtOwner.Enabled = True txtModel.Enabled = True txtNotes.Enabled = True ' txtFoamAdj.Enabled = True ' txtLaborAdj.Enabled = True ' txtWireAdj.Enabled = True txtFin2.Enabled = True txt28Foam.Enabled = True ' txtSuperBB.Enabled = True If mboolCOMM Then txtSuperBB.Enabled = True Else txtSuperBB.Enabled = False End If txtSuper12.Enabled = True txtSuper783.Enabled = True txtSuper78.Enabled = True txtSuper38.Enabled = True ' txtSuper1383.Enabled = True ' txtSuperRL.Enabled = True ' txtSuperML.Enabled = True ' txtSuperDW.Enabled = True txtSuperSP.Enabled = True txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) lblLathPrint.Visible = False lblFirst.Visible = False End Sub Private Sub FormShowMat() Dim strTYPE As String On Error GoTo Error_EH mboolSHOW = True With moRSMat txtLMInvNo = Field2Str(!inv_no) txtLMDesc = Field2Str(!Desc) txtLMQty = Field2Str(!qty) If CInt(txtLMQty) < 0 Then ' txtLMQty = Format(txtLMQty, "(####)") txtLMQty.ForeColor = &HFF& txtLMQty.FontBold = True Else txtLMQty.ForeColor = &H0& txtLMQty.FontBold = False End If txtLMLength = Field2Integer(!calc_amt) txtLMBalance = Field2Str(!o_qty) chkChange = Field2CheckBox(!ch_flag) If !d_flag = "S" Then cboLMDFlag.Text = "Supplier" Else cboLMDFlag.Text = "Yard" End If strTYPE = Field2Str(!m_type) Call FindType(cboLMType, strTYPE) If !calc_flag = "M" Then cboLMMetal.Text = "Metal" Else cboLMMetal.Text = "None" End If End With mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShowMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShowOpt() On Error GoTo Error_EH mboolSHOW = True With moRSPOpt txtLOYdge = Field2Integer(!Yardage) txtLODesc = Field2Str(!Desc) txtLOFin2 = Field2Integer(!fin2) txtLOFoam = Field2Integer(!f_adj) lblBillingAmt = Field2Integer(!Amt) txtNote = Field2Str(!notes) chkOStone = Field2CheckBox(!ostone) txtOST_SqFt = Field2Str2(!OSt_SqFt) Call FindTexture2(Field2Str(!texture), strTYPE) txtLOTexture = strTYPE ' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) End With mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShowOpt" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShowPOpt() On Error GoTo Error_EH mboolSHOW = True With moRSPOpt2 txtNote2 = Field2Str(!notes) If Left(Field2Str(!Desc), 3) = "DNU" Then mboolDNU = True Else mboolDNU = False End If End With mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShowPOpt" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShowPO() Dim bytPOType As Byte On Error GoTo Error_EH mboolSHOW = True With moRSPO gintPONUM = Field2Long(!ponum) txtPONum = Field2Long(!ponum) txtIssueTo = Field2Str(!towhom) txtPODesc = Field2Str(!Desc) txtPONotes = Field2Str(!notes) txtPODate = Field2Str(!Date) txtPay = Field2Str2(!yards) txtPayType = Field2Str(!payflag) txtPOType = Field2Str(!potype) gstrPO = txtPOType bytPOType = Field2Str2(!Opt_Type) End With If bytPOType = 1 Then optLath = True ElseIf bytPOType = 2 Then optStucco = True ElseIf bytPOType = 3 Then optSand = True ElseIf bytPOType = 4 Then optPreOrder = True ElseIf bytPOType = 5 Then optStone = True ElseIf bytPOType = 6 Or bytPOType = 0 Then optNone = True End If If moRSPO!p_flg = "P" Then cmdPrintPO.Enabled = False Else cmdPrintPO.Enabled = True End If mboolSHOW = False If Field2Integer(txtPay) > 0 And Not moRSPO!pay_flag Then cmdPrintPOPay.Enabled = True Else cmdPrintPOPay.Enabled = False End If Select Case txtPOType Case "L" lblIssueTo = "Invoice Description:" txtIssueTo.Visible = True lblIssueTo.Visible = True lblDesc = "Pay Description:" txtPODesc.Visible = True lblDesc.Visible = True lblPayYds = "Pay Yards:" txtPay.Visible = True lblPayYds.Visible = True txtPayType.Visible = True Case "Y" lblIssueTo.Visible = False txtIssueTo.Visible = False lblDesc = "Supplier:" txtPODesc.Visible = True lblPayYds.Visible = False txtPay.Visible = False txtPayType.Visible = False Case "V" lblIssueTo = "Mileage:" txtIssueTo.Visible = True lblDesc = "Supplier:" txtPODesc.Visible = True lblPayYds.Visible = False txtPay.Visible = False txtPayType.Visible = False Case "M" lblIssueTo = "Person Requesting:" txtIssueTo.Visible = True lblDesc = "Supplier:" txtPODesc.Visible = True lblPayYds.Visible = False txtPay.Visible = False txtPayType.Visible = False End Select Call CBFindString1(cboPOType, txtPOType) Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShowPO" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShowOptMat() Dim strTYPE As String On Error GoTo Error_EH mboolSHOW = True With moRSOptMat txtLOMInvNo = Field2Str(!inv_no) txtLOMDesc = Field2Str(!Desc) txtLOMQty = Field2Str(!qty) txtLOMLength = Field2Integer(!calc_amt) If !d_flag = "S" Then cboLOMDFlag.Text = "Supplier" ' cboLOMDFlag.ListIndex = 0 Else cboLOMDFlag.Text = "Yard" ' cboLOMDFlag.ListIndex = 1 End If strTYPE = Field2Str(!m_type) Call FindType(cboLOMType, strTYPE) If !calc_flag = "M" Then cboLOMetal.Text = "Metal" Else cboLOMetal.Text = "None" End If End With mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShowOptMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormShowPOMat() Dim strTYPE As String On Error GoTo Error_EH mboolSHOW = True With moRSPOMAT txtPOInvNo = Field2Str(!inv_no) txtPOMatDesc = Field2Str(!Desc) txtPOQty = Field2Str(!qty) If !d_flag = "S" Then cboPODFlag.Text = "Supplier" Else cboPODFlag.Text = "Yard" End If strTYPE = Field2Str(!m_type) Call FindType(cboPOMType, strTYPE) End With mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module FormShowPOMat" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormSave() Dim strName As String On Error GoTo Error_EH If IsNull(txtModel) Then MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" Exit Sub ElseIf Trim$(txtModel) = "" Then MsgBox "You Must Enter a Model/Elevation Before Saving", vbOKOnly, "Model Required" Exit Sub End If ' If mboolAdding Then ' moRS.AddNew ' End If ' Store the controls to the recordset Call FieldsSave moRS.Update If mboolAdding Then mboolAdding = False End If Exit Sub Error_EH: Call ErrorHandler(moRS.ActiveConnection) Exit Sub End Sub Private Sub ToggleButtons() cmdSaveLotInfo.Enabled = Not cmdSaveLotInfo.Enabled ' cmdAddLot.Enabled = Not cmdAddLot.Enabled cmdDelLot.Enabled = Not cmdDelLot.Enabled End Sub Private Sub TextChanged() If Not mboolSHOW Then If Not cmdSaveLotInfo.Enabled Then If gstrLOGIN = "TYF" Or gstrLOGIN = "TYF2" Then cmdAddLot.Enabled = False Else cmdAddLot.Enabled = True End If Call ToggleButtons End If End If End Sub Private Function FormFind() As Boolean Dim strSQL As String, strPlan As String, strMEMO As String Dim strSQLB As String, oRSB As Recordset On Error GoTo Error_EH strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID Set moRSMemo = New Recordset moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic If moRSMemo.RecordCount > 0 Then txtYardMemo = Field2Str(moRSMemo!notes) Else moRSMemo.AddNew moRSMemo!LOT_ID = gintLOTID moRSMemo!notes = "" moRSMemo.Update txtYardMemo = "" End If strSQL = "SELECT * " strSQL = strSQL & "FROM tblLotInfo " strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID Set moRS = New Recordset moRS.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If moRS.EOF Then FormFind = False Else FormFind = True If moRS!HLNotes = True Then mboolHLNotes = True Else mboolHLNotes = False End If mboolSTONE3 = False mstrPROJLOT = moRSProj!Proj_Code & " " & moRSProj!Proj_Desc & " " & moRS!lot_no mstrPLNELEV = Field2Str(moRS!model) If moRS!Split Then mboolSPLIT = False '*** Changed from True to False 7/21/2017 because no longer processing Split Qty Else mboolSPLIT = False End If strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" Set oRSB = New Recordset oRSB.Open strSQLB, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSB.EOF Then If IsNull(oRSB!st_code) Then mboolSTONE3 = True Else mboolSTONE3 = False End If End If End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFind" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Sub PlanFind() Dim oRS As Recordset Dim strSQL As String, strPlan As String, strTEST As String On Error GoTo Open_EH mintOpenPR = 0 ' strSQL = "SELECT * " strSQL = "SELECT est_id, verified, update, OpenPR " strSQL = strSQL & "FROM tblPlans " strSQL = strSQL & "WHERE Proj_ID = " & gintPROJID & " and Mod_Elv = """ & moRS!model & """" If moRSPlan.State = adStateOpen Then moRSPlan.Close End If moRSPlan.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If Not moRSPlan.EOF Then mintOpenPR = Field2Integer(moRSPlan!openpr) mboolVERIFIED = moRSPlan!verified gintESTID = moRSPlan!est_id If moRSProj!FHA Then strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1570'" Else strPlan = "SELECT qty FROM tblPlanMat where EST_ID = " & gintESTID & " and INV_NO = '1130'" End If Set oRS = New Recordset If oRS.State = adStateOpen Then oRS.Close End If oRS.Open strPlan, goConn, _ adOpenForwardOnly, adLockPessimistic If oRS.EOF Then mintTake138 = 0 Else moRS!jmb138 = oRS!qty ' mintTake138 = oRS!qty End If oRS.Close Else MsgBox "This lot does not have a valid plan - Call Darv", , "Critical Error" mboolCRITICAL = True End If Exit Sub Open_EH: gstrMODULE = "Form LotInfo - Module PlanFind" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Function FormFindPOpt() As Boolean Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT * " strSQL = strSQL & "FROM tblPOption " strSQL = strSQL & "WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) If moRSPOpt.State = adStateOpen Then moRSPOpt.Close End If moRSPOpt.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If moRSPOpt.EOF Then FormFindPOpt = False Else FormFindPOpt = True End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFindPOpt" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Function FormFindPOpt2() As Boolean Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT notes, optid, desc " strSQL = strSQL & "FROM tblPOption " strSQL = strSQL & "WHERE OPTID = " & lstPOptions.ItemData(lstPOptions.ListIndex) Set moRSPOpt2 = New Recordset moRSPOpt2.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If moRSPOpt2.EOF Then FormFindPOpt2 = False Else FormFindPOpt2 = True End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFindPOpt2" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Function FormFindPO() As Boolean Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT * FROM tblPOrder WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) If moRSPO.State = adStateOpen Then moRSPO.Close End If moRSPO.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If moRSPO.EOF Then FormFindPO = False Else FormFindPO = True End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FindPO" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Function FormFindLOpt() As Boolean Dim strSQL As String On Error GoTo Error_EH lblOptNum = "# " & lstLOptions.ItemData(lstLOptions.ListIndex) strSQL = "SELECT * " strSQL = strSQL & "FROM tblLOption " strSQL = strSQL & "WHERE Lot_id = " & gintLOTID Set moRSLOpt = New Recordset moRSLOpt.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic If moRSLOpt.EOF Then FormFindLOpt = False Else FormFindLOpt = True gintOPTID = moRSLOpt!Opt_ID End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFindLOpt" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Function FormFindOptMat() As Boolean Dim strSQL As String, strINVNO As String On Error GoTo Error_EH lstOptMatrl.col = 4 strINVNO = lstOptMatrl.ColText strSQL = "SELECT * FROM tblPOMatrl WHERE OPTID = " & lstLOptions.ItemData(lstLOptions.ListIndex) & " and Inv_No = '" & strINVNO & "'" If moRSOptMat.State = adStateOpen Then moRSOptMat.Close End If moRSOptMat.Open strSQL, goConn, adOpenKeyset, adLockPessimistic If moRSOptMat.EOF Then FormFindOptMat = False Else FormFindOptMat = True End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFindOptMat" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Function FormFindPOMat() As Boolean Dim strSQL As String, strINVNO As String On Error GoTo Error_EH lstPOMaterial.col = 3 strINVNO = lstPOMaterial.ColText strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & strINVNO & "'" ' strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = " & lstPO.ItemData(lstPO.ListIndex) & " and Inv_No = '" & lstPOMaterial.ItemData(lstPOMaterial.ListIndex) & "'" If moRSPOMAT.State = adStateOpen Then moRSPOMAT.Close End If moRSPOMAT.Open strSQL, goConn, adOpenKeyset, adLockPessimistic If moRSPOMAT.EOF Then FormFindPOMat = False Else FormFindPOMat = True End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFindPOMat" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Function FormFindMat() As Boolean Dim strSQL As String, strINVNO As String On Error GoTo Error_EH lstLMaterial.col = 4 strINVNO = Trim(Field2Str(lstLMaterial.ColText)) Set moRSMat = New Recordset strSQL = "SELECT * " strSQL = strSQL & "FROM tblLotMatrl " strSQL = strSQL & "WHERE LOT_ID = " & gintLOTID & " AND INV_NO = '" & strINVNO & "'" moRSMat.Open strSQL, goConn, adOpenKeyset, adLockOptimistic ' intTest = moRSMat.RecordCount If moRSMat.EOF Then FormFindMat = False Else FormFindMat = True End If Exit Function Error_EH: gstrMODULE = "Form LotInfo - Module FormFindMat" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Sub cmdExit_Click() Unload Me End Sub Private Sub FieldsSave() Dim strLOT As String, strTYPE As String, int1383 As Integer Dim dblOPEN As Double, intDELETE As Integer On Error GoTo Error_EH If mboolAdding Then moRS.AddNew moRS!Proj_ID = gintPROJID moRS!createuser = gstrLOGIN moRS!est_id = gintESTID moRS!import = Date moRS!imuser = gstrLOGIN moRS!startdate = Str2Field(mstrSTARTDATE) End If If mboolPLNCHANGE Then moRS!startdate = Str2Field(mstrSTARTDATE) mboolPLNCHANGE = False End If '***COMMENTING THIS OUT BECAUSE I DO NOT THINK IT NEEDS IT - Messes up the labor calcuations '****** If there are problems remove the single comments ' If Field2Integer(moRS!sq_yd) > 1 Then ' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) ' If moRSProj!use_open Then ' If Field2Integer(moRS!sq_yd) > 500 Then '' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 '' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) '' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 ' intDELETE = 19 ' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - intDELETE ' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 5 - intDELETE ' Else '' moRS!l_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 19 '' moRS!s_yds = (Field2Integer(moRS!sq_yd) - dblOPEN) - 24 ' moRS!l_yds = (Field2Integer(moRS!sq_yd)) - 10 'Change per Jesse 08/22/05 ' moRS!s_yds = (Field2Integer(moRS!sq_yd)) - 15 'Change per Jesse 08/22/05 ''' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 '' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 ' End If ' Else ' If Field2Integer(moRS!sq_yd) > 500 Then '' If Field2Integer(moRS!sq_yd) > 400 Then '*********** changed per Jesse 10/13/12 '' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.06) + 0.99) '' intDELETE = Int((Field2Integer(moRS!sq_yd) * 0.05) + 0.99) ' Change for Jesse 06/14/05 ' intDELETE = 19 ' moRS!l_yds = Field2Integer(moRS!sq_yd) - intDELETE ' moRS!s_yds = Field2Integer(moRS!sq_yd) - 5 - intDELETE ' Else '' moRS!s_yds = Field2Integer(moRS!sq_yd) - 10 ' moRS!l_yds = Field2Integer(moRS!sq_yd) - 10 ' moRS!s_yds = Field2Integer(moRS!sq_yd) - 15 '' moRS!l_yds = (Field2Integer(moRS!sq_yd)) ' - 10 'Change per Jesse 10/13/12 '' moRS!s_yds = (Field2Integer(moRS!sq_yd)) ' - 15 'Change per Jesse 10/13/12 ' End If ' End If ' End If With moRS If mboolHLNotes Then !HLNotes = vbChecked Else !HLNotes = vbUnchecked End If !zone = Integer2Field(moRSProj!zone) !sq_yd = Integer2Field(txtTtlYdge) !address = Str2Field(txtAddress) !Owner = Str2Field(txtOwner) !model = Str2Field(txtModel) !CMU = Integer2Field(txtCMUYdge) !notes = Str2Field(txtNotes) !supernotes = Str2Field(txtSuperNotes) !lotnotes = Str2Field(txtLotNotes) !st_adj = mintST_ADJ ' !f_adj = Integer2Field(txtFoamAdj) ' !l_adj = Integer2Field(txtLaborAdj) !f_adj = Field2Str2(mstrFoamAdj) !l_adj = Field2Str2(mstrLaborAdj) !w_adj = Field2Str2(mstrWireAdj) !fin2 = Integer2Field(txtFin2) !lot_no = Str2Field(txtLotNo) !foam = Integer2Field(txt28Foam) !lorder = Date2Field(txtLathO) !SUP_BB = Integer2Field(txtSuperBB) !SUP_FD12 = Integer2Field(txtSuper12) !SUP_783 = Integer2Field(txtSuper783) !SUP_78 = Integer2Field(txtSuper78) !SUP_38 = Integer2Field(txtSuper38) int1383 = Integer2Field(txtSuper1383) If int1383 < 0 Then !SUP_138 = 0 Else !SUP_138 = Integer2Field(txtSuper1383) End If !SUP_RL = Integer2Field(txtSuperRL) !SUP_ML = Integer2Field(txtSuperML) !SUP_DW = Integer2Field(txtSuperDW) !SUP_SP = Integer2Field(txtSuperSP) !opening = Integer2Field(txtOPEN) !openpr = mintOpenPR !sand_ton = Integer2Field(txtSand) !SORDER = Str2Field(txtTextureO) !Border = Str2Field(txtSandO) !TORDER = Str2Field(txtScratchO) !forder = Str2Field(txtBrownO) !VOrder = Str2Field(txtLathBill) !st_bill = Integer2Field(txtStoneBill) !jobcost = Str2Field(txtJC) !hold_stucco = chkHoldOrders !hold_po = chkHoldPO !PNT_FLG = chkPaint !LUUser = gstrLOGIN !Update = Date '*** This is just using the current date for updating !Firsttime = chkFirst !syn_flag = chkSynthetic !stone = chkStone !otstone = chkOthers ' !ST_SQFT = Integer2Field(txtStone) Call FindTexture(txtFinish, strTYPE) !texture = strTYPE End With moRS.Update If mboolAdding Then Call GetLotID Call PlanMatLoad Call POptLoad Call JCSetup If FormFind() Then Call FormShow 'xxxxxxxxxxxxxxxxxx End If mboolAdding = False End If moRSMemo!notes = Field2Str(txtYardMemo) moRSMemo.Update Exit Sub Error_EH: If Err.Number = -2147467259 Then MsgBox "Duplicate Lot Record - This will not be saved - ReEnter", , "Duplicate Record" strLOT = InputBox("Enter a New Lot Number", "Fix Duplicate") If Len(strLOT) > 0 Then moRS!lot_no = Field2Str(strLOT) txtLotNo = Field2Str(strLOT) txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") moRS!jobcost = Field2Str(txtJC) moRS.Update End If Resume Next End If gstrMODULE = "Form LotInfo - Module FieldsSave" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub GetLotID() Dim oRSMAX As Recordset Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT Max(Lot_ID) as MAXLotid from tblLotInfo" Set oRSMAX = New Recordset oRSMAX.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly gintLOTID = oRSMAX!maxLotid oRSMAX.Close Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module GetLotID" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub GetPlanInfo() Dim oRS As Recordset Dim strSQL As String On Error GoTo Error_EH mboolPLANUP = False strSQL = "SELECT Est_Id, Update from tblPlans WHERE Est_Id = " & moRS!est_id Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRS.EOF Then mstrPLANUP = Field2Str(oRS!Update) ' mboolVERIFIED = oRS!verified If mstrPLANUP > Field2Str(moRS!import) Then mboolPLANUP = True End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module GetPlanInfo" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub POSave() Dim strSQL As String, strMAX As String Dim oRS As Recordset, oRSS As Recordset Dim bytPOType As Byte On Error GoTo Error_EH If optLath Then bytPOType = 1 ElseIf optStucco Then bytPOType = 2 ElseIf optSand Then bytPOType = 3 ElseIf optPreOrder Then bytPOType = 4 ElseIf optStone Then bytPOType = 5 Else bytPOType = 6 End If If moRSPO.State = adStateClosed Then strSQL = "SELECT * FROM tblPOrder WHERE ponum = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic If Not oRS.EOF Then End If oRS.AddNew With oRS !Proj_ID = gintPROJID !LOT_ID = gintLOTID !towhom = Str2Field(txtIssueTo) !Desc = Str2Field(txtPODesc) !Opt_Type = bytPOType !Date = Str2Field(txtPODate) !User = gstrLOGIN !Up_User = gstrLOGIN !Update = Date !notes = Str2Field(txtPONotes) !yards = Str2Field(txtPay) !payflag = Str2Field(txtPayType) !potype = Left(cboPOType.Text, 1) End With oRS.Update oRS.Close Call POLoad If mboolAdding Then mboolAdding = False End If Exit Sub End If If mboolAdding Then moRSPO.AddNew moRSPO!User = gstrLOGIN End If With moRSPO !Proj_ID = gintPROJID !LOT_ID = gintLOTID !towhom = Str2Field(txtIssueTo) !Desc = Str2Field(txtPODesc) !Update = Date !Up_User = gstrLOGIN !Date = Str2Field(txtPODate) !notes = Str2Field(txtPONotes) !yards = Str2Field(txtPay) !payflag = Str2Field(txtPayType) !potype = Left(cboPOType.Text, 1) End With moRSPO.Update Exit Sub Error_EH: Call ErrorHandler(moRSPO.ActiveConnection) Exit Sub End Sub Private Sub POMatSave() Dim strSQL As String Dim oRS As Recordset On Error GoTo Error_EH If moRSPOMAT.State = adStateClosed Then strSQL = "SELECT * FROM tblPOrdMat WHERE ponum = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic oRS.AddNew With oRS !LOT_ID = gintLOTID !ponum = mintPONUM !inv_no = Str2Field(txtPOInvNo) !Desc = Str2Field(txtPOMatDesc) !qty = Str2Field(txtPOQty) !price = Str2Field(txtPOPrice) ' !price = Str2Field(txtPOPrice) !m_type = Left$(cboPOMType.Text, 1) If cboPODFlag.Text = "Supplier" Then !d_flag = "S" ElseIf cboPODFlag.Text = "Yard" Then !d_flag = "Y" End If End With oRS.Update oRS.Close Call OptMatLoad If mboolAdding Then mboolAdding = False End If Exit Sub End If If mboolAdding Then moRSPOMAT.AddNew End If With moRSPOMAT !LOT_ID = gintLOTID !ponum = mintPONUM !inv_no = Str2Field(txtPOInvNo) !Desc = Str2Field(txtPOMatDesc) !qty = Str2Field(txtPOQty) !price = Str2Field(txtPOPrice) !m_type = Left$(cboPOMType.Text, 1) If cboPODFlag.Text = "Supplier" Then !d_flag = "S" ElseIf cboPODFlag.Text = "Yard" Then !d_flag = "Y" End If End With moRSPOMAT.Update Exit Sub Error_EH: Call ErrorHandler(moRSPOMAT.ActiveConnection) Exit Sub End Sub Private Sub MatSave() Dim strSQL As String Dim oRS As Recordset '*** FIX On Error GoTo Error_EH If moRSMat.State = adStateClosed Then Exit Sub End If With moRSMat If mboolAdding Then .AddNew !LOT_ID = gintLOTID End If !inv_no = Str2Field(txtLMInvNo.Text) !Desc = Str2Field(txtLMDesc.Text) !qty = Str2Field(txtLMQty.Text) !calc_amt = Integer2Field(txtLMLength.Text) !o_qty = Integer2Field(txtLMBalance.Text) !ch_flag = chkChange !m_type = Left$(cboLMType.Text, 1) If cboLMDFlag.Text = "Supplier" Then !d_flag = "S" ElseIf cboLMDFlag.Text = "Yard" Then !d_flag = "Y" End If If cboLMMetal.Text = "Metal" Then !calc_flag = "M" Else !calc_flag = "" !calc_amt = 0 End If .Update End With mintINVNO = Field2Str2(txtLMInvNo) moRSMat.Update Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module MatSave" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormClear() moRSMemo.Close txtLotNotes = "" txtYardMemo = "" txtSuperNotes = "" txtTtlYdge = 0 txtAddress = "" txtOwner = "" txtModel = "" txtCMUYdge = 0 chkFirst = vbUnchecked txtNotes = "" txtNotes.ForeColor = &H80000008 txtNotes.BackColor = &H80000005 mboolPAINT = False lblFoamAdj.Caption = "Form Adj. Yardage: " lblLaborAdj.Caption = "Labor Adj. Yardage: " lblWireAdj.Caption = "Wire Adj. Yardage: " lblPaintSqFt.Caption = "Paint Square Ft.: " lblStoneSqFt.Caption = "Stone Square Ft.: " txtFin2 = 0 txtLotNo = "" txt28Foam = 0 txtLathO = "12/31/2030" txtMetal = 0 txtOPEN = 0 txtSuperBB = 0 txtSuper12 = 0 txtSuper783 = 0 txtSuper78 = 0 txtSuper38 = 0 txtSuper1383 = 0 txtSuperRL = 0 txtSuperML = 0 txtSuperDW = 0 txtSuperSP = 0 ' txtLathO = "" txtSandO = "" txtScratchO = "" txtBrownO = "" txtTextureO = "" txtLathBill = "" txtStoneBill = 0 txtFinish.Text = "" txtTake138 = 0 txtOneKote.Text = "" lstLath.Clear lstYard.Clear lstPreOrder.Clear lstLMaterial.Clear lstInventory.Clear lstPOptions.Clear lstLOptions.Clear lstOptMatrl.Clear lstPO.Clear lstPOMaterial.Clear lstBrown.Clear lstScratch.Clear lstTexture.Clear txtLOYdge = 0 txtLODesc = "" txtLOFin2 = 0 txtLOFoam = 0 txtLOMInvNo = 0 txtLOMDesc = "" txtLOMQty = "" txtSand = 0 txtLOMLength = 0 cboLOMDFlag.ListIndex = -1 cboLOMDFlag.Text = "" cboLOMType.ListIndex = -1 cboLOMType.Text = "" cboLOMetal.ListIndex = -1 cboLOMetal.Text = "" gintOPTID = 0 ' txtLODate.Enabled = False chkHoldOrders = vbUnchecked chkHoldOrders.Enabled = True chkHoldPO = vbUnchecked chkHoldPO.Enabled = True chkPaint = vbUnchecked chkSynthetic = vbUnchecked chkSynthetic.Enabled = True chkStone = vbUnchecked chkOthers = vbUnchecked chkNoPay = vbUnchecked chkStone.Enabled = True lblFirst.Visible = False lblSZone = "" lblSandShip = "" End Sub Private Sub MatLoad() Dim oRS As Recordset Dim strSQL As String Dim strLine As String '*** FIX On Error GoTo Error_EH strSQL = "SELECT LOT_id, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblLOTMatrl WHERE lot_id = " & gintLOTID & " ORDER BY Inv_No" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstLMaterial.Clear Do Until oRS.EOF With lstLMaterial strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.Close If lstLMaterial.ListCount Then lstLMaterial.ListIndex = 0 Else txtLMInvNo = "0" txtLMDesc = "" txtLMQty = "0" txtLMLength = "0" cboLMDFlag.ListIndex = -1 cboLMType.ListIndex = -1 cboLMMetal.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module MatLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub POMatLoad() Dim oRS As Recordset Dim strSQL As String, intINVNO As Integer Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT PONum, Inv_no, Desc, Qty, D_Flag, M_Type FROM tblPOrdMat WHERE PONum = " & mintPONUM & " ORDER BY Inv_No" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstPOMaterial.Clear Do Until oRS.EOF With lstPOMaterial strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") .AddItem strLine ' .ItemData(.NewIndex) = Field2Str(oRS("inv_no")) If mboolAdding Then ' intINVNO = Field2Str(txtPOInvNo) If Field2Str(txtPOInvNo) = Field2Str(oRS!inv_no) Then mintBOOKMARK = .ListIndex End If End If End With oRS.MoveNext Loop oRS.Close If lstPOMaterial.ListCount Then lstPOMaterial.ListIndex = 0 Else txtPOInvNo = "0" txtPOMatDesc = "" txtPOQty = "0" cboPODFlag.ListIndex = -1 cboPOMType.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module POMatLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PlanMatLoad() Dim oRS As Recordset, oRSS As Recordset Dim strSQL As String, strSQLL As String Dim strLine As String, intCOUNT As Integer On Error GoTo Error_EH strSQL = "SELECT * from tblPlanMat WHERE est_id = " & gintESTID & " ORDER BY Inv_No" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly intCOUNT = oRS.RecordCount strSQLL = "SELECT * from tblLotMatrl WHERE lot_id = 0" Set oRSS = New Recordset oRSS.Open strSQLL, goConn, adOpenKeyset, adLockOptimistic intCOUNT = oRSS.RecordCount Do Until oRS.EOF oRSS.AddNew oRSS!LOT_ID = gintLOTID oRSS!inv_no = Field2Str(oRS!inv_no) oRSS!Desc = Field2Str(oRS!Desc) oRSS!d_flag = Field2Str(oRS!d_flag) oRSS!m_type = Field2Str(oRS!m_type) oRSS!calc_flag = Field2Str(oRS!calc_flag) oRSS!calc_amt = Field2Integer(oRS!calc_amt) oRSS!qty = Field2Str2(oRS!qty) ' oRSS!price = 0 oRSS!price = Field2Str2(oRS!price) oRSS.Update If moRSProj!FHA Then If Field2Str(oRS!inv_no) = 1570 Then ' mintTake138 = Field2Str(oRS!qty) moRS!jmb138 = Field2Str(oRS!qty) txtTake138 = Field2Str(moRS!jmb138) ' txtTake138 = mintTake138 End If Else If Field2Str(oRS!inv_no) = 1130 Then ' mintTake138 = Field2Str(oRS!qty) moRS!jmb138 = Field2Str(oRS!qty) txtTake138 = Field2Str(moRS!jmb138) ' txtTake138 = mintTake138 End If End If oRS.MoveNext Loop oRS.Close Exit Sub Error_EH: If Err = "-2147467259" Then Resume Next Else Call ErrorHandler(oRSS.ActiveConnection) Exit Sub End If ' Resume Next End Sub Private Sub InventoryLoad() Dim oRS As Recordset Dim strSQL As String Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT Inv_no, Desc from tblInvtry WHERE inv_type = " & gbytINV_TYPE & " ORDER BY Inv_no" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstInventory.Clear Do Until oRS.EOF With lstInventory strLine = oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS!inv_no End With oRS.MoveNext Loop oRS.Close If lstInventory.ListCount Then lstInventory.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module InventoryLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub OptMatLoad() Dim oRS As Recordset Dim strSQL As String, strSELECT As String Dim strLine As String On Error GoTo Error_EH If lstLOptions.ListIndex = -1 Then lstOptMatrl.ListIndex = -1 Exit Sub End If strSELECT = lstLOptions.ItemData(lstLOptions.ListIndex) strSQL = "SELECT OPTID, Inv_no, Desc, Qty, D_Flag, M_Type, Calc_Flag from tblPOMatrl WHERE optid = " & strSELECT 'gintOPTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstOptMatrl.Clear Do Until oRS.EOF With lstOptMatrl strLine = oRS("D_Flag") & vbTab & oRS("M_Type") & vbTab & oRS("Calc_Flag") & vbTab & oRS("Qty") & vbTab & oRS("Inv_No") & vbTab & oRS("desc") .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.Close If lstOptMatrl.ListCount Then lstOptMatrl.ListIndex = 0 Else txtLOMInvNo = "0" txtLOMDesc = "" txtLOMQty = "0" txtLOMLength = "0" cboLOMDFlag.ListIndex = -1 cboLOMDFlag.Text = "" cboLOMType.ListIndex = -1 cboLOMType.Text = "" cboLOMetal.ListIndex = -1 cboLOMetal.Text = "" lstOptMatrl.ListIndex = -1 End If Exit Sub Error_EH: If Err = 381 Then strSELECT = 0 cmdOptDel.Enabled = False Resume Next End If End Sub Private Sub POptLoad() Dim oRS As Recordset Dim strSQL As String Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT OPTID, Opt_No, Desc, Yardage from tblPOption WHERE Est_id = " & gintESTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstPOptions.Clear Do Until oRS.EOF With lstPOptions strLine = oRS("Yardage") & vbTab & oRS("desc") .AddItem strLine .ItemData(.NewIndex) = oRS("OPTID") End With oRS.MoveNext Loop oRS.Close If lstPOptions.ListCount Then lstPOptions.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module POptLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub POLoad() Dim oRS As Recordset Dim strSQL As String Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT ponum from tblPOrder WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstPO.Clear Do Until oRS.EOF With lstPO .AddItem oRS!ponum .ItemData(.NewIndex) = oRS!ponum End With oRS.MoveNext Loop oRS.Close If lstPO.ListCount Then lstPO.ListIndex = 0 mintPONUM = lstPO.ItemData(lstPO.ListIndex) End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module POLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub LOptLoad() Dim oRS As Recordset Dim strSQL As String, intLoop As Integer, intPos As Integer Dim strLine As String On Error GoTo Error_EH strSQL = "SELECT OPT_ID from tblLOption WHERE Lot_ID = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstLOptions.Clear Do Until oRS.EOF With lstLOptions For intLoop = 0 To lstPOptions.ListCount - 1 If lstPOptions.ItemData(intLoop) = oRS!Opt_ID Then .AddItem (lstPOptions.List(intLoop)) .ItemData(.NewIndex) = oRS!Opt_ID End If Next intLoop End With oRS.MoveNext Loop oRS.Close If lstLOptions.ListCount Then lstLOptions.ListIndex = 0 gintOPTID = lstLOptions.ItemData(lstLOptions.ListIndex) Else lstLOptions.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module LOptLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstInventory_DblClick() Dim oRS As Recordset, strINVNO As String Dim strSQL As String, strTYPE As String '*** FIX On Error GoTo Error_EH lstInventory.col = 0 strINVNO = Field2Str(lstInventory.ColText) strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & strINVNO & "'" ' strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Calc_Flag, Calc_Amt from tblInvtry where Inv_no = '" & lstInventory.ItemData(lstInventory.ListIndex) & "'" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly With oRS txtLMInvNo = Field2Str(!inv_no) txtLMDesc = Field2Str(!Desc) txtLMLength = Field2Integer(!calc_amt) If !d_flag = "S" Then cboLMDFlag.Text = "Supplier" Else cboLMDFlag.Text = "Yard" End If strTYPE = !m_type Call FindType(cboLMType, strTYPE) If !calc_flag = "M" Then cboLMMetal.Text = "Metal" Else cboLMMetal.Text = "None" End If End With oRS.Close lstInventory.Visible = False Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstInventory_DblClick" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstLMaterial_DblClick() mboolAdding = False cmdAddMatrl.Enabled = False cmdSaveMatrl.Enabled = True cmdDelMatrl.Enabled = True End Sub Private Sub lstLookup_DblClick() Dim oRS As Recordset, strINVNO As String Dim strSQL As String, strTYPE As String '*** FIX On Error GoTo Error_EH lstLOOKUP.col = 0 strINVNO = lstLOOKUP.ColText strSQL = "SELECT Inv_no, Desc, D_Flag, M_Type, Price from tblInvtry where Inv_no = '" & strINVNO & "'" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly With oRS txtPOInvNo = Field2Str(!inv_no) txtPOMatDesc = Field2Str(!Desc) txtPOPrice = Field2Str2(!price) If !d_flag = "S" Then cboPODFlag.Text = "Supplier" Else cboPODFlag.Text = "Yard" End If strTYPE = !m_type Call FindType(cboPOMType, strTYPE) End With txtPOQty.SetFocus oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstLookup_dblClick" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstLOptions_Click() On Error GoTo Error_EH If lstLOptions.ListIndex <> -1 Then If FormFindPOpt() Then Call FormShowOpt Call OptMatLoad If lstOptMatrl.ListIndex <> -1 Then If FormFindOptMat() Then Call FormShowOptMat Else lstOptMatrl.Clear txtLOMInvNo = "0" txtLOMDesc = "" txtLOMQty = "0" txtLOMLength = "0" cboLOMDFlag.Text = "" cboLOMType.Text = "" cboLOMetal.Text = "" End If End If Else lstLOptions.Clear txtLOYdge = "0" txtLODesc = "" txtLOFin2 = "0" txtLOFoam = "0" txtLOTexture = "" End If If FormFindLOpt() Then ' lblOptNum = "# " & Trim(Field2Str(moRSLOpt!Opt_ID)) End If Else cmdOptDel.Enabled = False End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstLOptions_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstLOptions_DblClick() If IsNull(moRS!l_FLG) Or gconACTION = 5 Then cmdOptDel.Enabled = True cmdOptAdd.Enabled = False End If End Sub Private Sub lstOptMatrl_Click() On Error GoTo Error_EH If lstOptMatrl.ListIndex <> -1 Then If FormFindOptMat() Then Call FormShowOptMat Else lstOptMatrl.Clear txtLOMInvNo = "0" txtLOMDesc = "" txtLOMQty = "0" txtLOMLength = "0" cboLOMDFlag.Text = "" cboLOMType.Text = "" cboLOMetal.Text = "" End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstOptMatrl_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstLMaterial_Click() '*** FIX On Error GoTo Error_EH If lstLMaterial.ListIndex <> -1 Then If FormFindMat() Then Call FormShowMat Else lstLMaterial.Clear txtLMInvNo = "0" txtLMDesc = "" txtLMQty = "0" txtLMLength = "0" cboLMDFlag.ListIndex = -1 cboLMType.ListIndex = -1 cboLMMetal.ListIndex = -1 txtLMBalance = "" End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstLMaterial_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstPO_DblClick() If chkHoldPO Then MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" Exit Sub End If If moRSPO!p_flg = "P" Then gconACTION = 2 End If ' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then cmdSavePO.Enabled = True cmdDelPO.Enabled = False cmdAddPO.Enabled = False cmdAddPOMat.Enabled = False cmdDelPOMat.Enabled = False cmdSavePOMat.Enabled = False cmdPrintPO.Enabled = False End If End Sub Private Sub lstPOMaterial_Click() On Error GoTo Error_EH If lstPOMaterial.ListIndex <> -1 Then If FormFindPOMat() Then Call FormShowPOMat Else lstPOMaterial.Clear txtPOInvNo = "0" txtPOMatDesc = "" txtPOQty = "0" cboPODFlag.ListIndex = -1 cboPOMType.ListIndex = -1 End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstPOMaterial_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstPO_Click() On Error GoTo Error_EH If lstPO.ListIndex <> -1 Then If FormFindPO() Then mintPONUM = lstPO.ItemData(lstPO.ListIndex) Call FormShowPO Call POMatLoad If lstPOMaterial.ListIndex <> -1 Then If FormFindPOMat() Then Call FormShowPOMat Else lstPOMaterial.Clear txtPOInvNo = "0" txtPOMatDesc = "" txtPOQty = "0" cboPODFlag.ListIndex = -1 cboPOMType.ListIndex = -1 End If End If Else lstPO.Clear txtPONum = "0" txtPODesc = "" txtIssueTo = "" End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstPO_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub OrderLoad() Dim oRS As Recordset Dim strSQL As String, strLine As String, strSELECT As String On Error Resume Next strSQL = "SELECT Inv_no, Desc, Qty, D_Flag, M_Type from tblLotMatrl WHERE Lot_ID = " & gintLOTID & " ORDER BY inv_no" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly strSELECT = "M_Type = 'P'" ' strSELECT = "D_Flag = 'S' and M_Type = 'P'" oRS.Filter = strSELECT lstPreOrder.Clear Do Until oRS.EOF With lstPreOrder strLine = oRS!d_flag & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.MoveFirst strSELECT = "M_Type = 'Z'" oRS.Filter = strSELECT Do Until oRS.EOF With lstPreOrder strLine = oRS!d_flag & " " & oRS!m_type & vbTab & oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.MoveFirst strSELECT = "D_Flag = 'S' and M_Type = 'L'" oRS.Filter = strSELECT lstLath.Clear Do Until oRS.EOF With lstLath strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.MoveFirst strSELECT = "D_Flag = 'Y' and M_Type = 'L'" oRS.Filter = strSELECT lstYard.Clear Do Until oRS.EOF With lstYard strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.MoveFirst strSELECT = "D_Flag = 'S' and M_Type = 'S'" oRS.Filter = strSELECT lstScratch.Clear Do Until oRS.EOF With lstScratch strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.MoveFirst strSELECT = "D_Flag = 'S' and M_Type = 'B'" oRS.Filter = strSELECT lstBrown.Clear Do Until oRS.EOF With lstBrown strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.MoveFirst strSELECT = "D_Flag = 'S' and M_Type = 'T'" oRS.Filter = strSELECT lstTexture.Clear Do Until oRS.EOF With lstTexture strLine = oRS!qty & vbTab & oRS!inv_no & vbTab & oRS!Desc .AddItem strLine ' .ItemData(.NewIndex) = oRS("inv_no") End With oRS.MoveNext Loop oRS.Close If lstPreOrder.ListCount Then lstPreOrder.ListIndex = -1 End If If lstLath.ListCount Then lstLath.ListIndex = -1 End If If lstYard.ListCount Then lstYard.ListIndex = -1 End If If lstScratch.ListCount Then lstScratch.ListIndex = -1 End If If lstBrown.ListCount Then lstBrown.ListIndex = -1 End If If lstTexture.ListCount Then lstTexture.ListIndex = -1 End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module OrderLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub lstPlans_DblClick() txtModel = lstPlans.List(lstPlans.ListIndex) lstPlans.Visible = False lblPlan.Visible = False Call cmdFindPlan_Click End Sub Private Sub lstPOMaterial_DblClick() If chkHoldPO Then MsgBox "All PO's Are On Hold - OK to View - No Processing", vbOKOnly, "PO's on Hold" Exit Sub End If If moRSPO!p_flg = "P" Then gconACTION = 2 End If ' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then cmdSavePO.Enabled = False cmdDelPO.Enabled = False cmdAddPO.Enabled = False cmdAddPOMat.Enabled = False cmdDelPOMat.Enabled = False cmdSavePOMat.Enabled = True cmdPrintPO.Enabled = False txtPOInvNo.Enabled = True txtPOMatDesc.Enabled = True txtPOQty.Enabled = True txtPOPrice.Enabled = True cboPODFlag.Enabled = True cboPOMType.Enabled = True cmdFindPOMat.Enabled = True End If End Sub Private Sub lstPOptions_Click() On Error GoTo Error_EH If lstPOptions.ListIndex <> -1 Then If FormFindPOpt2() Then Call FormShowPOpt End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module lstPOptions_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub MatClear() txtLMInvNo = "0" txtLMDesc = "" txtLMQty = "0" txtLMLength = "0" txtLMBalance = "0" chkChange = vbUnchecked cboLMDFlag.ListIndex = -1 cboLMType.ListIndex = -1 cboLMMetal.ListIndex = -1 End Sub Private Sub POClear() txtPOInvNo = "0" txtPOMatDesc = "" txtPOQty = "0" txtPONotes = "" txtIssueTo = "" txtPONum = "0" txtPODesc = "" txtPODate = "" txtPay = 0 txtPayType = "" lstLOOKUP.Clear lstPOMaterial.Clear cboPODFlag.ListIndex = -1 cboPOMType.ListIndex = -1 cboPOType.ListIndex = -1 End Sub Private Sub POMatClear() txtPOInvNo = "0" txtPOMatDesc = "" txtPOQty = "0" lstLOOKUP.Clear cboPODFlag.ListIndex = -1 cboPOMType.ListIndex = -1 cmdFindPOMat.Visible = True End Sub Private Sub lstPOptions_DblClick() If mboolDNU Then MsgBox "A DNU Option Cannot Be Used - Select Another Option", vbOKOnly, "Select Again" Exit Sub Else If IsNull(moRS!l_FLG) Or gconACTION = 5 Then lstPOptions.Enabled = False cmdOptAdd.Enabled = True cmdOptDel.Enabled = False End If End If End Sub Private Sub SSTLotInfo_GotFocus() If SSTLotInfo.Tab = 1 Then txtSuperBB = IIf(txtSuperBB = "", 0, txtSuperBB) txtSuper12 = IIf(txtSuper12 = "", 0, txtSuper12) txtSuperSP = IIf(txtSuperSP = "", 0, txtSuperSP) txtSuperDW = IIf(txtSuperDW = "", 0, txtSuperDW) txtSuperRL = IIf(txtSuperRL = "", 0, txtSuperRL) txtSuperML = IIf(txtSuperML = "", 0, txtSuperML) txtSuper38 = IIf(txtSuper38 = "", 0, txtSuper38) txtSuper78 = IIf(txtSuper78 = "", 0, txtSuper78) txtSuper783 = IIf(txtSuper783 = "", 0, txtSuper783) txtSuper1383 = IIf(txtSuper1383 = "", 0, txtSuper1383) End If If SSTLotInfo.Tab = 6 Then If chkHoldPO Then cmdAddPO.Enabled = False cmdSavePO.Enabled = False cmdDelPO.Enabled = False cmdPrintPO.Enabled = False cmdPrintForm.Enabled = False cmdAddPOMat.Enabled = False cmdSavePOMat.Enabled = False cmdDelPOMat.Enabled = False txtPONum.Enabled = False txtPODate.Enabled = False txtIssueTo.Enabled = False txtPODesc.Enabled = False txtPay.Enabled = False txtPayType.Enabled = False txtPONotes.Enabled = False txtPOInvNo.Enabled = False txtPOMatDesc.Enabled = False txtPOQty.Enabled = False cboPODFlag.Enabled = False cboPOMType.Enabled = False txtPOPrice.Enabled = False cmdPrintPOPay.Enabled = False cmdFindPOMat.Enabled = False lstLOOKUP.Visible = False Else ' If gbytSECURITY <> 6 And lstPO.ListCount > 4 Then If gbytSECURITY <> 6 And lstPO.ListCount > moRSProj!pomax Then cmdAddPO.Enabled = True End If End If End If End Sub Private Sub txt28Foam_GotFocus() Call FieldSelect(txt28Foam) End Sub Private Sub txtFin2_GotFocus() Call FieldSelect(txtFin2) End Sub Private Sub txtIssueTo_GotFocus() Call FieldSelect(txtIssueTo) End Sub Private Sub txtIssueTo_LostFocus() txtIssueTo = UCase(txtIssueTo) End Sub Private Sub txtJC_GotFocus() Call FieldSelect(txtJC) End Sub Private Sub txtJC_LostFocus() txtJC = UCase(txtJC) End Sub Private Sub txtLMDesc_LostFocus() txtLMDesc = UCase(txtLMDesc) End Sub Private Sub txtLMInvNo_GotFocus() Call FieldSelect(txtLMInvNo) End Sub Private Sub txtLMInvNo_LostFocus() txtLMInvNo = UCase(txtLMInvNo) End Sub Private Sub txtLMQty_LostFocus() If mdblQTY <> Field2Str2(txtLMQty) Then If gconACTION <> 5 Then gconACTION = 6 End If End If mstrENDQTY = txtLMQty End Sub Private Sub txtLOMInvNo_LostFocus() txtLOMInvNo = UCase(txtLOMInvNo) End Sub Private Sub txtLOMQty_GotFocus() mdblQTY = Field2Str2(txtLOMQty) End Sub Private Sub txtLOMQty_LostFocus() If mdblQTY <> Field2Str2(txtLOMQty) Then If gconACTION <> 5 Then gconACTION = 6 End If End If End Sub Private Sub txtLotNotes_GotFocus() txtLotNotes.SelStart = 1000 End Sub Private Sub txtLotNotes_LostFocus() txtLotNotes = UCase(txtLotNotes) End Sub Private Sub txtModel_LostFocus() txtModel = UCase(txtModel) End Sub Private Sub txtPay_GotFocus() Call FieldSelect(txtPay) End Sub Private Sub txtPayType_GotFocus() Call FieldSelect(txtPayType) End Sub Private Sub txtPayType_LostFocus() txtPayType = UCase(txtPayType) If txtPayType = "D" Or txtPayType = "R" Then lblPayYds.Caption = "Pay Dollars:" Else lblPayYds.Caption = "Pay Yards:" End If End Sub Private Sub txtPODate_LostFocus() Dim lngPOS As Long lngPOS = InStr(1, txtPODate, "/", 1) If Not IsDate(txtPODate) Then If lngPOS = 0 Then If Len(txtPODate) > 0 Then txtPODate = Format(txtPODate, "00/00/####") If Not IsDate(txtPODate) Then MsgBox "The Date You Entered is not Valid - ReEnter" txtPODate.SetFocus End If End If Else MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" txtPODate.SetFocus End If End If End Sub Private Sub txtPOInvNo_LostFocus() txtPOInvNo = UCase(txtPOInvNo) End Sub Private Sub txtPOQty_LostFocus() If mdblQTY <> Field2Str2(txtPOQty) Then If moRSPO!p_flg = "P" Then gconACTION = 2 End If End If End Sub Private Sub txtLMDesc_GotFocus() Call FieldSelect(txtLMDesc) End Sub Private Sub txtLMLength_GotFocus() Call FieldSelect(txtLMLength) End Sub Private Sub txtLMQty_GotFocus() mdblQTY = Field2Str2(txtLMQty) mstrBEGQTY = Field2Str(txtLMQty) Call FieldSelect(txtLMQty) End Sub Private Sub txtLotNo_LostFocus() txtLotNo = UCase(txtLotNo) Call GETJC ' txtJC = Field2Str(moRSProj!jccode) & Format(Left(Field2Str(txtLotNo), 3), "000") End Sub Private Sub GETJC() Dim strSQL As String, intJC As Integer, txtALPHA As String, intASCII As Integer Dim oRS As Recordset strSQL = "SELECT * FROM tblSYSINFO" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockOptimistic intJC = Field2Integer(oRS!nextjc) txtALPHA = Field2Str(oRS!jcalpha) txtJC = txtALPHA & Format(Field2Str(intJC), "000000") intJC = intJC + 1 If intJC > 999999 Then intJC = 1 intASCII = Asc(txtALPHA) intASCII = intASCII + 1 txtALPHA = Chr(intASCII) oRS!jcalpha = Field2Str(txtALPHA) End If oRS!nextjc = intJC oRS.Update End Sub Private Sub txtModel_GotFocus() Call FieldSelect(txtModel) End Sub Private Sub txtOwner_GotFocus() Call FieldSelect(txtOwner) End Sub Private Sub txtOwner_LostFocus() txtOwner.Text = UCase(txtOwner.Text) End Sub Private Sub txtAddress_LostFocus() txtAddress.Text = UCase(txtAddress.Text) End Sub Private Sub txtAddress_GotFocus() Call FieldSelect(txtAddress) End Sub Private Sub txtNotes_LostFocus() txtNotes.Text = UCase(txtNotes.Text) End Sub Private Sub txtPODate_GotFocus() Call FieldSelect(txtPODate) End Sub Private Sub txtPODesc_GotFocus() Call FieldSelect(txtPODesc) End Sub Private Sub txtPODesc_LostFocus() txtPODesc = UCase(txtPODesc) End Sub Private Sub txtPOInvNo_GotFocus() Call FieldSelect(txtPOInvNo) End Sub Private Sub txtPOMatDesc_GotFocus() Call FieldSelect(txtPOMatDesc) End Sub Private Sub txtPOMatDesc_LostFocus() txtPOMatDesc = UCase(txtPOMatDesc) End Sub Private Sub txtPONotes_GotFocus() Call FieldSelect(txtPONotes) End Sub Private Sub txtPONotes_LostFocus() txtPONotes = UCase(txtPONotes) End Sub Private Sub txtPOQty_GotFocus() mdblQTY = Field2Str2(txtPOQty) Call FieldSelect(txtPOQty) End Sub Private Sub txtSuper12_GotFocus() Call FieldSelect(txtSuper12) End Sub Private Sub txtSuper12_LostFocus() txtSuper12 = Integer2Field(txtSuper12) If Field2Str(moRS!l_FLG) <> "P" Then If txtSuper12 = 0 And txtSuperBB = 0 Then cmdCalc.Enabled = False Else cmdCalc.Enabled = True End If End If End Sub Private Sub txtSuper1383_LostFocus() Dim intResponse As Integer txtSuper1383 = Integer2Field(txtSuper1383) If (Field2Integer(txtSuper1383) + Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) > Field2Str2(txtTake138) Then intResponse = MsgBox("The sum of all JMB is greater than the Takeoff Amount." & Chr(13) & "Do you want to Continue?", vbYesNo, "Over JMB Amount") If intResponse = vbYes Then Exit Sub Else txtSuper1383.SetFocus End If End If End Sub Private Sub txtSuper38_GotFocus() Call FieldSelect(txtSuper38) End Sub Private Sub txtSuper78_GotFocus() Call FieldSelect(txtSuper78) End Sub Private Sub txtSuper1383_GotFocus() Call FieldSelect(txtSuper1383) End Sub Private Sub txtSuper783_GotFocus() Call FieldSelect(txtSuper783) End Sub Private Sub txtSuper783_LostFocus() txtSuper783 = Integer2Field(txtSuper783) txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) If CInt(txtCalc138) < 0 Then txtCalc138 = 0 End If txtSuper1383 = Integer2Field(txtCalc138) End Sub Private Sub txtSuper78_LostFocus() txtSuper78 = Integer2Field(txtSuper78) txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) If CInt(txtCalc138) < 0 Then txtCalc138 = 0 End If txtSuper1383 = Integer2Field(txtCalc138) End Sub Private Sub txtSuper38_LostFocus() txtSuper38 = Integer2Field(txtSuper38) txtCalc138 = txtTake138 - (Field2Integer(txtSuper783) + Field2Integer(txtSuper78) + Field2Integer(txtSuper38)) If CInt(txtCalc138) < 0 Then txtCalc138 = 0 End If txtSuper1383 = Integer2Field(txtCalc138) End Sub Private Sub txtSuperBB_GotFocus() If mboolCOMM Then Call FieldSelect(txtSuperBB) End If End Sub Private Sub txtSuperBB_LostFocus() If mboolCOMM Then txtSuperBB = Integer2Field(txtSuperBB) End If End Sub Private Sub txtSuperDW_GotFocus() Call FieldSelect(txtSuperDW) End Sub Private Sub txtSuperDW_LostFocus() txtSuperDW = Integer2Field(txtSuperDW) End Sub Private Sub txtSuperML_GotFocus() Call FieldSelect(txtSuperML) End Sub Private Sub txtSuperML_LostFocus() txtSuperML = Integer2Field(txtSuperML) End Sub Private Sub txtSuperNotes_GotFocus() Call FieldSelect(txtSuperNotes) End Sub Private Sub txtSuperNotes_LostFocus() txtSuperNotes.Text = UCase(txtSuperNotes.Text) End Sub 'Private Sub txtSuperRL_GotFocus() ' Call FieldSelect(txtSuperRL) 'End Sub 'Private Sub txtSuperRL_LostFocus() ' txtSuperRL = Integer2Field(txtSuperRL) 'End Sub Private Sub txtSuperSP_GotFocus() Call FieldSelect(txtSuperSP) End Sub Private Sub MatCalcOne() Dim dblRL As Double, dblBB As Double, dblDW As Double, dblSP As Double, intOpenPR As Integer, intUSEOpen As Integer Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double, dblDW2 As Double Dim dblFD48 As Double, dblKote1 As Double, dblCMNT As Double, dblLime As Double Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant Dim oRSC As Recordset, oRC As Recordset, strSql2 As String, dblARL As Double, dblPYRO As Double Dim dblSYN As Double, dblSYNP As Double, dblOPEN As Double, dblWire As Double Dim strFIN2 As String, strFIN1 As String, intDELETE As Integer, boolDEDUCT As Boolean Dim dblML As Double, dblAML As Double, dblNEWYDS As Double, intCaulkQty As Integer Dim mboolBAG100 As Boolean, dblBAGSAND As Double, dblCalcBAGSAND As Double, dblCMNT2 As Double Dim dblML2 As Double, dblRL2 As Double, dblMLC As Double, dblL_ADJ As Double, dblS_ADJ As Double Dim dblBB5, dblRG125, dblRG15, dblPYRO5 As Double, dblRL3 As Double Dim oRS As Recordset Dim intMATOpen As Integer, dblMATYDS As Double, dblMOPEN As Double On Error GoTo Error_EH dblL_ADJ = Field2Str2(moRS!l_adj) dblS_ADJ = Field2Str2(moRS!l_adj) mboolBAG100 = False ' mboolSilica = False mboolBADD = False If mstrWIRE <> "O" Then MsgBox "Wire Type Is Incorrect for OneCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" mboolBADD = True Exit Sub End If If moRSProj!BagSand Then mboolBAG100 = True dblCalcBAGSAND = Field2Integer(moRSProj!bagdollars) Else mboolBAG100 = False End If intOpenPR = Field2Integer(moRS!openpr) If intOpenPR > 89 Then 'Changed to 90% per Jesse 07/09/2018 ' If intOpenPR > 75 Then Else intUSEOpen = 90 - intOpenPR 'Changed to 90% per Jesse 07/09/2018 intMATOpen = 50 - intOpenPR ' 10/4/2018 This is a new variable to take only 50% if openings for material yardage ' intUSEOpen = 75 - intOpenPR ' intUSEOpen = 100 - intOpenPR End If dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) dblMOPEN = Int(((Field2Double(moRS!opening) * intMATOpen) / 100) + 0.99) ' dblOPEN = 0 If Field2Integer(moRS!sq_yd) > 500 Then '****** changed per Jesse 10/13/12 -- Changed back to 500 on 7/9/2018 ' If Field2Integer(moRS!sq_yd) > 300 Then '****** changed per Jesse 12/11/17 -- Changed back to 500 on 7/9/2018 ' If Field2Integer(moRS!sq_yd) > 400 Then boolDEDUCT = True dblNEWYDS = Field2Integer(moRS!sq_yd) - dblOPEN ' + Field2Integer(moRS!opening) dblMATYDS = Field2Integer(moRS!sq_yd) - dblMOPEN '10/04/2018 changed by Jesse to give more material ' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) Else boolDEDUCT = False dblNEWYDS = Field2Integer(moRS!sq_yd) dblMATYDS = Field2Integer(moRS!sq_yd) '- dblMOPEN '10/04/2018 changed by Jesse to give more material End If dblPYRO = 1 '' If moRSProj!use_open Then '***************** November 30, 2017 per Jesse, if checked then use 50% otherwise use 100% of openings '' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) ' dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) '' Else '' dblOPEN = Int((Field2Double(moRS!opening)) + 0.99) '' End If '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 '**** Also had me start taking openings off material yds on lots over 400 If moRSProj!use_open Then '***************** November 30, 2017 per Jesse, if checked then use 50% otherwise use 100% of openings ' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 If Field2Integer(dblNEWYDS) > 500 Then ' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 ' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) ' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 ' intDELETE = 19 'Stop Taking This Per Jesse 7/9/2018 intDELETE = 0 ' moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE 'Changed 12/11/17 per Jesse ' moRS!s_yds = ((Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE) - 5 'Changed 12/11/17 per Jesse ' moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE + dblL_ADJ 'Changed 7/9/18 per Jesse moRS!l_yds = (Field2Integer(dblNEWYDS)) - intDELETE - 5 + dblL_ADJ moRS!s_yds = ((Field2Integer(dblNEWYDS)) - intDELETE) - 5 + dblS_ADJ 'Changed 12/11/17 per Jesse Else ' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 ' moRS!s_yds = (Field2Integer(dblnewyds) - dblOPEN) - 24 ' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 'Change per Jesse 08/22/05 ' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 'Change per Jesse 08/22/05 moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 7/9/18 moRS!s_yds = (Field2Integer(dblNEWYDS)) + dblS_ADJ 'Change per Jesse 7/9/18 ' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 10 + dblL_ADJ 'Change per Jesse 10/13/12 ' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 15 + dblS_ADJ 'Change per Jesse 10/13/12 ' moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 04/12/18 ' moRS!s_yds = (Field2Integer(dblNEWYDS)) - 5 + dblS_ADJ 'Change per Jesse 04/12/18 End If Else ' moRS!s_yds = Field2Integer(dblnewyds) - 24 If Field2Integer(dblNEWYDS) > 500 Then ' If Field2Integer(dblNEWYDS) > 400 Then '**** changed per Jesse 10/13/2012 ' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) ' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) ' Change for Jesse 06/14/05 intDELETE = 0 moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + dblL_ADJ moRS!s_yds = Field2Integer(dblNEWYDS) - intDELETE - 5 + dblS_ADJ Else ' moRS!l_yds = Field2Integer(dblNEWYDS) - 10 ' moRS!s_yds = Field2Integer(dblNEWYDS) - 15 moRS!l_yds = (Field2Integer(dblNEWYDS)) + dblL_ADJ 'Change per Jesse 10/13/12 moRS!s_yds = (Field2Integer(dblNEWYDS)) + dblS_ADJ 'Change per Jesse 10/13/12 End If End If strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not ch_flag and lot_id = " & gintLOTID goConn.Execute strSQL strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID Set moRSCMat = New Recordset moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic If moRSProj!stype <> "T" Then 'Black Paper If IsNull(txtSuper12) Then txtSuper12 = 0 End If dblFD12 = CInt(txtSuper12) If txtSuperSP > "" Then dblSP = CDbl(txtSuperSP) ElseIf dblSP = 0 Then dblSP = (dblFD12 / 2) Else dblSP = 0 End If 'Setup Drywall For Black Paper Calculations strSQL = "SELECT * FROM tblLotMatrl WHERE Lot_ID = " & Field2Str2(moRS!LOT_ID) & " AND Inv_No = '4034'" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRS.EOF Then dblDW2 = Int((Field2Str2(oRS!qty) * 3.5)) ' dblDW2 = Int((Field2Str2(oRS!qty) * 3.5) * 2) End If oRS.Close strSQL = "SELECT * FROM tblLotMatrl WHERE Lot_ID = " & Field2Str2(moRS!LOT_ID) & " AND Inv_No = '4035'" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRS.EOF Then dblDW2 = Int((Field2Str2(oRS!qty) * 3.5)) ' dblDW2 = Int((Field2Str2(oRS!qty) * 3.5) * 2) End If oRS.Close '******* Need to determine ML quantity moRSCMat.MoveFirst strSELECT = "inv_no = '1370'" moRSCMat.Find strSELECT If moRSCMat.EOF Then dblML = 0 Else dblML = Field2Integer(moRSCMat!qty) End If If dblML > 0 Then moRSCMat.MoveFirst strSELECT = "inv_no = '1375'" moRSCMat.Find strSELECT If moRSCMat.EOF Then dblML2 = 0 Else dblML2 = Field2Integer(moRSCMat!qty) dblML = dblML + dblML2 dblML2 = 0 End If Else moRSCMat.MoveFirst strSELECT = "inv_no = '1375'" moRSCMat.Find strSELECT If moRSCMat.EOF Then dblML = 0 Else dblML = Field2Integer(moRSCMat!qty) End If End If ' If Not dblML > 0 Then If dblML > 0 Then moRSCMat.MoveFirst strSELECT = "inv_no = '1371'" moRSCMat.Find strSELECT If moRSCMat.EOF Then dblML2 = 0 dblMLC = 0 Else dblML2 = Field2Integer(moRSCMat!qty) dblMLC = Field2Integer(moRSCMat!qty) dblMLC = Int((dblMLC * 1.77) + 0.99) dblML = dblML + dblML2 dblML2 = 0 End If Else moRSCMat.MoveFirst strSELECT = "inv_no = '1371'" moRSCMat.Find strSELECT If moRSCMat.EOF Then dblML = 0 dblMLC = 0 Else dblML = Field2Integer(moRSCMat!qty) dblMLC = Field2Integer(moRSCMat!qty) End If End If If txtSuperML > 5 And dblML = 0 Then ' If txtSuperML > 5 Then dblML2 = Field2Integer(txtSuperML) dblML = dblML + dblML2 - 5 dblML2 = 0 End If ' If Not dblML > 0 Then ' moRSCMat.MoveFirst ' strSELECT = "inv_no = '1375'" ' moRSCMat.Find strSELECT ' If moRSCMat.EOF Then ' dblML = 0 ' Else ' dblML = Field2Integer(moRSCMat!qty) ' End If ' End If ' If Not dblML > 0 Then ' moRSCMat.MoveFirst ' strSELECT = "inv_no = '1371'" ' moRSCMat.Find strSELECT ' If moRSCMat.EOF Then ' dblML = 0 ' Else ' dblML = Field2Integer(moRSCMat!qty) ' End If ' End If ' If txtSuperML > 5 Then' ' dblML = Field2Integer(txtSuperML) ' End If ' If txtSuperRL = -2 Then ' Takeoff RL to always be used per Jesse on 5/14/18 ' also make sure that foam and wire is adjusted '******* Need to make takeoff RL to be dblRL moRSCMat.MoveFirst strSELECT = "inv_no = '1330'" moRSCMat.Find strSELECT If moRSCMat.EOF Then dblRL = 0 Else dblRL = Field2Integer(moRSCMat!qty) End If ' Else ' If txtSuperRL = -1 Then ' strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = 1330" ' goConn.Execute strSQL ' End If ' If txtSuperRL > 0 Then ' dblRL = CInt(txtSuperRL) ' moRSCMat.MoveFirst ' strSELECT = "inv_no = '1330'" ' moRSCMat.Find strSELECT ' If moRSCMat.EOF Then ' moRSCMat.MovePrevious ' strGET = "SELECT * FROM tblInvtry where inv_no = 1330" ' Set oRSC = New Recordset ' oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic ' moRSCMat.AddNew ' moRSCMat!Lot_id = gintLOTID ' moRSCMat!inv_no = "1330" ' moRSCMat!Desc = Field2Str(oRSC!Desc) ' moRSCMat!d_flag = Field2Str(oRSC!d_flag) ' moRSCMat!m_type = Field2Str(oRSC!m_type) ' moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) ' moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) ' ' moRSCMat!rc_flag = vbChecked ' moRSCMat!qty = Field2Str(txtSuperRL) ' moRSCMat!ch_flag = vbChecked ' moRSCMat.Update ' Else ' moRSCMat!qty = Field2Str(txtSuperRL) ' moRSCMat!ch_flag = vbChecked ' moRSCMat.Update ' End If ' Else ' moRSCMat.MoveFirst ' strSELECT = "inv_no = '1330'" ' moRSCMat.Find strSELECT ' If moRSCMat.EOF Then ' dblRL = 0 ' Else ' dblRL = Field2Integer(moRSCMat!qty) ' End If ' End If ' End If '**** Black Board/R-Guard Calcuations If txtSuperBB > 0 Then dblBB = CInt(txtSuperBB) Else ' ElseIf moRSProj!bb Then moRSCMat.MoveFirst strSELECT = "inv_no = '1310'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then dblBB5 = Field2Str(moRSCMat!qty) ' Else ' dblBB = 0 End If ' ElseIf moRSProj!rg12 Then moRSCMat.MoveFirst strSELECT = "inv_no = '1315'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then dblRG125 = Field2Str2(moRSCMat!qty) ' txtSuperBB = Field2Str2(moRSCMat!Qty) End If ' ElseIf moRSProj!rg1 Then moRSCMat.MoveFirst strSELECT = "inv_no = '1317'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then dblRG15 = Field2Str2(moRSCMat!qty) ' txtSuperBB = Field2Str2(moRSCMat!Qty) End If ' ElseIf moRSProj!pyro Then moRSCMat.MoveFirst strSELECT = "inv_no = '1805'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then dblPYRO5 = Field2Str2(moRSCMat!qty) ' txtSuperBB = Field2Str2(moRSCMat!Qty) End If End If moRSCMat.MoveFirst strSELECT = "inv_no = '1310'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then moRSCMat.Delete Else moRSCMat.MoveFirst strSELECT = "inv_no = '1315'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then ' txtSuperBB = Field2Str2(moRSCMat!Qty) moRSCMat.Delete End If End If If moRSProj!rg1 Then moRSCMat.MoveFirst strSELECT = "inv_no = '1317'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then ' txtSuperBB = Field2Str2(moRSCMat!Qty) moRSCMat.Delete End If End If If moRSProj!pyro Then moRSCMat.MoveFirst strSELECT = "inv_no = '1805'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then moRSCMat.Delete End If End If If dblBB5 > 0 And moRSProj!bb Then dblBB = dblBB5 End If If dblRG125 > 0 And (moRSProj!rg12 Or moRSProj!rg1) Then dblBB = dblRG125 End If If dblRG15 > 0 And moRSProj!rg1 Then dblBB = dblRG15 End If If moRSProj!pyro Then dblBB = dblPYRO5 End If If txtSuperBB = -1 Then Else If moRSProj!bb Then strGET = "SELECT * FROM tblInvtry where inv_no = 1310" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) ' moRSCMat!Qty = Field2Str(txtSuperBB) moRSCMat!qty = dblBB moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbChecked moRSCMat.Update ' strSELECT = "inv_no = '1310'" ' moRSCMat.Find strSELECT ' dblBB = Field2Str(moRSCMat!Qty) Else If moRSProj!rg12 Then strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) ' moRSCMat!Qty = Field2Str(txtSuperBB) moRSCMat!qty = dblBB moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbChecked moRSCMat.Update ' strSELECT = "inv_no = '1315'" ' moRSCMat.Find strSELECT ' dblBB = Field2Str(moRSCMat!Qty) ElseIf moRSProj!rg1 Then strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) ' moRSCMat!Qty = Field2Str(txtSuperBB) moRSCMat!qty = dblBB moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbUnchecked ' moRSCMat!ch_flag = vbChecked moRSCMat.Update ' strSELECT = "inv_no = '1317'" ' moRSCMat.Find strSELECT ' dblBB = Field2Str(moRSCMat!Qty) ' End If ElseIf moRSProj!pyro Then strGET = "SELECT * FROM tblInvtry where inv_no = '1805'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!qty = dblPYRO ' moRSCMat!qty = Field2Str(txtSuperBB) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbChecked moRSCMat.Update strSELECT = "inv_no = '1805'" moRSCMat.Find strSELECT dblBB = Field2Str(moRSCMat!qty) End If End If End If '*** Calc Black Paper If moRSProj!bp_type = "" Then ' response = MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") ' MsgBox("No BlackPaper is Defined in Subdivision Code - " & moRSProj!proj_code, vbOKOnly, "Black Paper Error") = vbOK MsgBox "No BlackPaper is Defined for this Subdivision" Exit Sub End If If moRSProj!bp_type = "B1" Then '1 Roll of BP plus sheer dblBP = 1 + Int((((dblSP * 32) / 9) / 33) + 0.99) End If If moRSProj!bp_type = "B2" Then 'double cover sheer and BB If moRSProj!bb Then dblBP = Int(((((dblFD12 * 1.77) + ((dblBB * 3.5) + (dblSP * 3.5)) * 2)) / 33) + 0.99) Else dblBP = Int(((((dblFD12 * 1.77) + (dblSP * 3.5) * 2)) / 33) + 0.99) End If End If If moRSProj!bp_type = "BA" Then 'cover entire house once dblBP = Int((CDbl(dblNEWYDS) / 33) + 0.99) End If If moRSProj!bp_type = "BC" Then 'cover entire house once plus sheer and BB If dblNEWYDS < 325 Then If moRSProj!bb Then dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) ' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) Else dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + dblDW2 + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) ' dblBP = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) End If Else If moRSProj!bb Then dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) ' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) Else dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + dblDW2 + (dblSP * 3.5)) / 33) + 0.99) ' dblBP = Int(((CDbl(dblNEWYDS) + (dblFD12 * 1.77) + (dblBB * 3.5) + (dblSP * 3.5)) / 33) + 0.99) End If End If End If If moRSProj!bp_type = "BF" Then 'double cover under 1/2 foam dblBP = Int((((dblFD12 * 1.77) * 2) / 33) + 0.99) End If If moRSProj!bp_type = "BS" Then 'double cover sheer panel only dblBP = Int((((dblSP * 3.5) * 2) / 33) + 0.99) End If If moRSProj!bp_type = "BD" Then 'double cover entire house If dblNEWYDS > 325 Then dblBP = Int(((CDbl(dblNEWYDS) * 2) / 33) + 0.99) Else dblBP = Int((((CDbl(dblNEWYDS) + dblOPEN) * 2) / 33) + 0.99) End If End If ' If moRSProj!bp_type = "TV" Then 'cover entire house once ' dblBP = Int(((CDbl(dblNEWYDS)) / 30) + 0.99) ' End If If moRSProj!bp_type = "TV" Then 'TYVEK Commercial Calculation dblBP = Int(((CDbl(dblNEWYDS)) / 100) + 0.99) End If If moRSProj!bp_type = "BT" Then 'cover entire house once plus sheer and BB If moRSProj!bb Then ' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate Else ' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 33) + 0.99) dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5)) / 33) + 0.99) '10/04/2018 Per Jesse to use full yardate End If End If '********************FINISH DEALING WITH BP TYPE BR*********** ' If moRSProj!bp_type = "BR" Then 'TYPAR Calculation for Ryland ' dblBP = Int((((dblFD12 * 1.77)) / 16) + 0.99) ' End If If moRSProj!bp_type = "B6" Then 'cover entire house once with 60 min paper plus sheer and BB If moRSProj!bb Then dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) Else dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) * 1.5) + 0.99) End If End If If moRSProj!bp_type = "B7" Then 'cover entire house once with 2 ply paper plus sheer and BB If moRSProj!bb Then dblBP = Int(((CDbl(dblMATYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) '10/04/2018 Changed per Jesse to use full yardage ' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 16) + 0.99) Else dblBP = Int((((CDbl(dblMATYDS) + (dblSP * 3.5)) / 16)) + 0.99) '10/04/2018 Changed per Jesse to use full yardage ' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16)) + 0.99) ' Changed 10/12/15 per Jesse ' dblBP = Int((((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 16) * 1.5) + 0.99) End If End If If moRSProj!bp_type = "TV" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1815' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1815'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) ' moRSCMat!qty = ((dblBP * 3) * 0.9) moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If ElseIf moRSProj!bp_type = "TC" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1817' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1817'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1816' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1816'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int(((CDbl(dblNEWYDS)) / 300) + 0.99) ' moRSCMat!qty = ((dblBP * 3) * 0.9) moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If ElseIf moRSProj!bp_type = "B6" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If ElseIf moRSProj!bp_type = "B7" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenDynamic, adLockPessimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update Else oRC!qty = dblBP oRC.Update End If End If 'Stucco Wire 'Changed the Yardage figure to match what is used for all of the calculations (dblNEWYDS instead of txtTtlYdge) 'to calc wire better for Jesse 12/14/17 dblWire = Field2Integer(mstrWireAdj) ' If dblRL > 5 Then 'CHanged 1/9/2018 per Jesse - Remove all RL from Wire Calculation dblARL = Int(((dblRL) * 1.77) + 0.99) ' Else ' dblARL = 0 ' dblARL = Int(((dblRL) * 1.77) + 0.99) ' End If If dblML > 5 Then dblAML = Int(((dblML - 5) * 1.77) + 0.99) Else dblAML = 0 End If '**** Wire Yardage CHanged to 40 yards at Jesse's request on June 28, 2005 '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 '**** Wire Yardage CHanged to 50 yards at Jesse's request on March 24, 2010 '**** Wire Yardage CHanged to 45 yards at Jesse's request on June 28, 2005 If CDbl(txtTtlYdge) < 350 Then dblCALC = Int((((CDbl(dblNEWYDS) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) ' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.49) ' dblCALC = Int((((CDbl(txtTtlYdge)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'changed per Jesse 12/11/17 ' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 50) + 0.99) ' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblAML + dblARL + dblWire)) / 45) + 0.99) ' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 40) + 0.99) ' dblCALC = Int((((CDbl(txtTtlYdge) + CDbl(moRS!opening)) - (dblARL + dblWire)) / 50) + 0.99) Else dblCALC = Int(((CDbl(dblNEWYDS) - (dblAML + dblARL + dblWire)) / 45) + 0.99) ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.49) ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) 'changed per Jesse 12/11/17 ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblAML + dblARL + dblWire)) / 45) + 0.99) ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 40) + 0.99) ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblARL + dblWire)) / 50) + 0.99) End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1410' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1410'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = "1410" moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblCALC moRSCMat.Update dblCALC = 0 Else oRC!qty = dblCALC oRC.Update End If 'Calculate 1 Kote, Cement, Lime, and Sand for the Current House strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) moRSCMat.Update Else oRC!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) moRSCMat.Update oRC.Close Else oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '9000' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '9000'" 'Green Floats Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) moRSCMat.Update Else oRC!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) oRC.Update End If If moRSProj!stype = "S" Then ' SUPERWALL One Kote If Field2Str2(moRSProj!sw_order) > 0 Then dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) Else dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblKote1 moRSCMat.Update Else oRC!qty = dblKote1 oRC.Update End If End If If moRSProj!stype = "B" Then ' SUPERWALL One Kote with synthetic texture If Field2Str2(moRSProj!sw_order) > 0 Then dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) Else dblKote1 = Int((CDbl(dblMATYDS) / 9) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / 9) + 0.99) End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '5220' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '5220'" 'Superwall Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblKote1 moRSCMat.Update Else oRC!qty = dblKote1 oRC.Update End If End If If moRSProj!stype = "W" Then ' WESTERN One Kote If Field2Str(moRSProj!sw_order) > 0 Then dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) Else dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2210' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2210'" 'WESTERN Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblKote1 moRSCMat.Update Else oRC!qty = dblKote1 oRC.Update End If End If If moRSProj!stype = "M" Then 'MAGNA WALL One Kote ' If Field2Str2(moRSProj!sw_order) > 0 Then If Field2Double(moRSProj!sw_order) > 0 Then dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) Else dblKote1 = Int((CDbl(dblMATYDS) / 8) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / 8) + 0.99) End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2250' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2250'" 'Magnawall Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblKote1 moRSCMat.Update Else oRC!qty = dblKote1 oRC.Update End If End If If moRSProj!stype = "N" Then ' SanMan Silo One Kote If Field2Str(moRSProj!sw_order) > 0 Then dblKote1 = Int((CDbl(dblMATYDS) / CDbl(moRSProj!sw_order)) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / CDbl(moRSProj!sw_order)) + 0.99) Else dblKote1 = Int((CDbl(dblMATYDS) / 10) + 0.99) '10/04/2018 Changed to use dblMATYDS to get more material ' dblKote1 = Int((CDbl(dblNEWYDS) / 10) + 0.99) End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2260' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2260'" 'San Man Silo Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblKote1 moRSCMat.Update Else oRC!qty = dblKote1 oRC.Update End If End If If moRS!texture = "" Then MsgBox "No Texture is Selected for This House - Check the Plan" Exit Sub End If 'This calculates the materials needed for the primary texture strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly strFIN2 = Field2Str(oRSC!Secondary) strFIN1 = Field2Str(oRSC!Primary) If moRS!fin2 > 0 Then ' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then ' If moRS!texture <> "DF" And moRS!texture <> "SB" And moRS!texture <> "MF" Then moRS!fin2 = 0 moRS.Update End If End If '**** takes extra yardage from dblNEWYDS for Cement/Lime/Silica Sand dblBatch = Int((((Field2Integer(dblMATYDS))) / Field2Integer(oRSC!yds)) + 0.99) ' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10)) / Field2Integer(oRSC!yds)) + 0.99) ' dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) If Field2Str2(oRSC!cmnt) > 0 Then dblCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) dblCMNT2 = dblCMNT Else dblCMNT = 0 End If If Field2Str2(oRSC!lime) > 0 Then dblLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) Else dblLime = 0 End If If Field2Str2(oRSC!s16) > 0 Then dblS16 = Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) Else dblS16 = 0 End If If Field2Str2(oRSC!s20) > 0 Then dblS20 = Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) Else dblS20 = 0 End If If Field2Str2(oRSC!s30) > 0 Then dblS30 = Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) Else dblS30 = 0 End If If Not mboolBAG100 And Field2Integer(oRSC!brs) > 0 Then dblRS = Int((((dblKote1 * Field2Integer(oRSC!brs)) + (dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) / 2000) + 0.99) Else dblRS = 0 End If If Field2Str(oRSC!id) = "SB" Then 'this calculates the synthetic needed for the base coat If Field2Double(moRSProj!syn_o) > 0 Then ' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) ' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2) + dblMLC) - 10) * 9) / Field2Double(moRSProj!syn_o)) + 0.99) Else dblSYN = Int(((((Field2Integer(dblMATYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) ' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2)) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) ' dblSYN = Int(((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!fin2) + dblMLC) - 10) * 9) / Field2Double(oRSC!yds)) + 0.99) End If End If 'This calculates the additional materials needed for the second texture On Error GoTo Error_EH2 If moRS!fin2 > 0 Then If strFIN2 = "SB" Then 'This calculates the synthetic needed for the second texture ' If Field2Str(oRSC!id) = "SB" Then 'This calculates the synthetic needed for the second texture If Field2Integer(moRSProj!syn_o2) > 0 Then dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(moRSProj!syn_o2)) + 0.99) ' Exit Sub Else dblSYNP = Int(((Field2Integer(moRS!fin2) * 9) / Field2Double(oRSC!s_yds)) + 0.99) ' Exit Sub End If ' ElseIf Field2Str(moRS!texture) = "DF" Or Field2Str(moRS!texture) = "MF" Then ElseIf Not (strFIN2 = "" Or strFIN2 = "0" Or IsNull(strFIN2)) Then strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly If Field2Integer(oRSC!yds) > 0 Then dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) If Field2Double(oRSC!cmnt) > 0 Then dblCMNT = dblCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) Else dblCMNT = 0 End If If Field2Integer(oRSC!lime) > 0 Then dblLime = dblLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) Else dblLime = 0 End If If Field2Str2(oRSC!s16) > 0 Then dblS16 = dblS16 + Int((dblBatch * Field2Str2(oRSC!s16)) + 0.99) 'Else ' dblS16 = 0 End If If Field2Str2(oRSC!s20) > 0 Then dblS20 = dblS20 + Int((dblBatch * Field2Str2(oRSC!s20)) + 0.99) 'Else ' dblS20 = 0 End If If Field2Str2(oRSC!s30) > 0 Then dblS30 = dblS30 + Int((dblBatch * Field2Str2(oRSC!s30)) + 0.99) 'Else ' dblS30 = 0 End If End If End If End If On Error GoTo Error_EH If dblCMNT > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblCMNT moRSCMat.Update Else oRC!qty = dblCMNT oRC.Update End If End If If dblLime > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Lime Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblLime moRSCMat.Update Else oRC!qty = dblLime oRC.Update End If End If If dblS16 > 0 Then If moRSProj!silica Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS16 moRSCMat.Update Else oRC!qty = dblS16 oRC.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS16 moRSCMat.Update Else oRC!qty = dblS16 oRC.Update End If End If End If If dblS20 > 0 Then If moRSProj!silica Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS20 moRSCMat.Update Else oRC!qty = dblS20 oRC.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS20 moRSCMat.Update Else oRC!qty = dblS20 oRC.Update End If End If End If If dblS30 > 0 Then If moRSProj!silica Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS30 moRSCMat.Update Else oRC!qty = dblS30 oRC.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS30 moRSCMat.Update Else oRC!qty = dblS30 oRC.Update End If End If End If If dblSYNP > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2601' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2601'" 'EIFS SANDBLAST Second Color Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblSYNP moRSCMat.Update Else oRC!qty = dblSYNP oRC.Update End If End If If dblSYN > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblSYN moRSCMat.Update Else oRC!qty = dblSYN oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS COLOR Fast Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) moRSCMat.Update Else oRC!qty = Int(((dblSYN + dblSYNP) / 10) + 0.99) oRC.Update End If End If If dblRS > 0 Then txtSand = dblRS End If If mboolBAG100 Then dblBAGSAND = Int(((dblCMNT2 + dblKote1) * dblCalcBAGSAND) + 0.99) End If If dblBAGSAND > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2350' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2350'" 'Bag Sand Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBAGSAND moRSCMat.Update Else oRC!qty = dblBAGSAND oRC.Update End If End If 'Calculate Foam If txt28Foam = 0 Then txt28Foam = 25 End If If dblRL < 5 Then dblRL3 = 5 Else dblRL3 = dblRL End If If Field2Integer(dblNEWYDS) < 325 Then dblFD1 = Int(((((Field2Integer(dblNEWYDS) + CDbl(moRS!opening)) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + (dblRL3 * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) Else ' dblFD1 = Int((((Field2Integer(dblNEWYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) dblFD1 = Int((((Field2Integer(dblMATYDS) - Field2Integer(moRS!f_adj)) - ((dblBB * 3.5) + (dblDW * 3.5) + ((dblRL3 - 5) * 1.77) + (dblFD12 * 1.77))) / 1.77) + 0.99) End If dblFD28 = Int(((dblFD1 * Field2Integer(txt28Foam)) / 100) + 0.99) dblFD48 = Int(((dblFD1 - dblFD28) / 2) + 0.99) If moRSProj!ftype = "O" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblFD28 moRSCMat.Update Else oRC!qty = dblFD28 oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblFD48 moRSCMat.Update Else oRC!qty = dblFD48 oRC.Update End If End If If moRSProj!ftype = "T" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1210' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1210'" '2X8 sheets of 1" Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblFD28 moRSCMat.Update Else oRC!qty = dblFD28 oRC.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1240' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1240'" '4X8 sheets of 1" Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblFD48 moRSCMat.Update Else oRC!qty = dblFD48 oRC.Update End If End If If moRSProj!ftype = "D" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1250' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1250'" '2X8 sheets of Dow Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblFD1 moRSCMat.Update Else oRC!qty = dblFD1 oRC.Update End If End If If moRSProj!ftype = "U" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1260' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1260'" '4X8 sheets of Urethane Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int((dblFD1 / 2) + 0.99) moRSCMat.Update Else oRC!qty = Int((dblFD1 / 2) + 0.99) oRC.Update End If End If If txtSuper12 > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1230'" '2X8 sheets of 1/2 inch Foam Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Field2Str(txtSuper12) moRSCMat.Update Else oRC!qty = Field2Str(txtSuper12) oRC.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1230' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenDynamic, adLockOptimistic If Not oRC.EOF Then oRC.Delete End If End If 'Calculate Nails strSELECT = "inv_no = 1610" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then 'Changed on 11/1/17 Per Rose - Jesse told after the fact ' If Field2Integer(dblNEWYDS) <= 550 Then If Field2Integer(dblNEWYDS) <= 2200 Then moRSCMat!qty = 1 ' ElseIf Field2Integer(dblNEWYDS) > 550 And Field2Integer(dblNEWYDS) <= 1250 Then ' moRSCMat!qty = 2 ' ElseIf Field2Integer(dblNEWYDS) > 1250 And Field2Integer(dblNEWYDS) <= 2200 Then ' moRSCMat!qty = 3 ' ElseIf Field2Integer(dblNEWYDS) > 2200 Then ' moRSCMat!qty = 4 'CHanged on 7/12/2017 per Rose ' If Field2Integer(dblNEWYDS) <= 450 Then ' moRSCMat!qty = 1 ' ElseIf Field2Integer(dblNEWYDS) > 450 And Field2Integer(dblNEWYDS) <= 750 Then ' moRSCMat!qty = 1.5 ' ElseIf Field2Integer(dblNEWYDS) > 750 And Field2Integer(dblNEWYDS) <= 1000 Then ' moRSCMat!qty = 2 ' ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1450 Then ' moRSCMat!qty = 2.5 ' ElseIf Field2Integer(dblNEWYDS) > 1450 And Field2Integer(dblNEWYDS) <= 1750 Then ' moRSCMat!qty = 3 ' ElseIf Field2Integer(dblNEWYDS) > 1750 And Field2Integer(dblNEWYDS) <= 2000 Then ' moRSCMat!qty = 3.5 End If End If moRSCMat.Update End If 'Calculate Staples strSELECT = "inv_no = '1710'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then If Field2Integer(dblNEWYDS) <= 250 Then moRSCMat!qty = 1 Else moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) End If End If moRSCMat.Update End If strSELECT = "inv_no = '1720'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then If Field2Integer(dblNEWYDS) <= 230 Then moRSCMat!qty = 1 Else moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 230) + 0.05), 1) End If End If moRSCMat.Update End If 'Rapid Staples strSELECT = "inv_no = '1730'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then If Field2Integer(dblNEWYDS) <= 280 Then moRSCMat!qty = 1 Else moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 280) + 0.99)) End If ' If Field2Integer(dblnewyds) <= 400 Then ' moRSCMat!qty = 1 ' ElseIf Field2Integer(dblnewyds) > 400 And Field2Integer(dblnewyds) <= 700 Then ' moRSCMat!qty = 2 ' ElseIf Field2Integer(dblnewyds) > 700 And Field2Integer(dblnewyds) <= 1000 Then ' moRSCMat!qty = 3 ' ElseIf Field2Integer(dblnewyds) > 1000 And Field2Integer(dblnewyds) <= 1300 Then ' moRSCMat!qty = 4 ' ElseIf Field2Integer(dblnewyds) > 1300 And Field2Integer(dblnewyds) <= 1600 Then ' moRSCMat!qty = 5 ' ElseIf Field2Integer(dblnewyds) > 1600 And Field2Integer(dblnewyds) <= 1900 Then ' moRSCMat!qty = 6 ' ElseIf Field2Integer(dblnewyds) > 1900 And Field2Integer(dblnewyds) <= 2200 Then ' moRSCMat!qty = 7 ' ElseIf Field2Integer(dblnewyds) > 2200 And Field2Integer(dblnewyds) <= 2500 Then ' moRSCMat!qty = 8 ' ElseIf Field2Integer(dblnewyds) > 2500 And Field2Integer(dblnewyds) <= 2800 Then ' moRSCMat!qty = 9 ' ElseIf Field2Integer(dblnewyds) > 2800 And Field2Integer(dblnewyds) <= 3100 Then ' moRSCMat!qty = 10 ' ElseIf Field2Integer(dblnewyds) > 3200 And Field2Integer(dblnewyds) <= 3500 Then ' moRSCMat!qty = 11 ' ElseIf Field2Integer(dblnewyds) > 3500 And Field2Integer(dblnewyds) <= 3800 Then ' moRSCMat!qty = 12 ' End If End If moRSCMat.Update End If 'Latex Caulking strSELECT = "inv_no = '1820'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then ' moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 25) * 1.5) + 0.99) Per ROse 7/12/2017 moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 2) + 0.99) moRSCMat.Update End If End If 'Mesh Tape strSELECT = "inv_no = '3200'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 90) + 0.99) moRSCMat.Update End If End If ' End If End If Call MatLoad Exit Sub Error_EH2: If Err = 11 Then Resume Next End If gstrMODULE = "Form LotInfo - Module MatCalcOne" Call ErrorHandler2 gstrMODULE = "" Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module MatCalcOne" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub MatCalcThree() Dim dblRL As Double, dblDW As Double, dblSP As Double Dim dblBP As Double, dblFD12 As Double, dblFD1 As Double, dblFD28 As Double Dim dblTLime As Double, dblTCMNT As Double, dblCMNT As Double, dblLime As Double Dim dblSCmnt As Double, dblSLime As Double, dblS16 As Double, dblS20 As Double Dim dblS30 As Double, dblRS As Double, dblBatch As Double, dblCALC As Double, dblSYN As Double Dim strSQL As String, strGET As String, strSELECT As String, vntTest As Variant Dim oRSC As Recordset, oRST As Recordset, oRC As Recordset, strSql2 As String Dim dblOPEN As Double, dblARL As Double, intDELETE As Integer Dim strFIN2 As String, strFIN1 As String, dblWire As Double, intUSEOpen As Integer Dim dblNEWYDS As Double, boolDEDUCT As Boolean, dblBB As Double, intOpenPR As Integer On Error GoTo Error_EH mboolBADD = False If mstrWIRE = "O" Then MsgBox "Wire Type Is Incorrect for ThreeCoat - Correct in Projects", vbOKOnly, "Invalid Wire Type" mboolBADD = True Exit Sub End If If Field2Integer(moRS!sq_yd) > 400 Then boolDEDUCT = True dblNEWYDS = Field2Integer(moRS!sq_yd) ' + Field2Integer(moRS!opening) ' dblNEWYDS = Field2Integer(moRS!sq_yd) + Field2Integer(moRS!opening) Else boolDEDUCT = False dblNEWYDS = Field2Integer(moRS!sq_yd) End If intOpenPR = Field2Integer(moRS!openpr) If intOpenPR > 89 Then 'Changed to 90% per Jesse 07/09/2018 Else intUSEOpen = 90 - intOpenPR 'Changed to 90% per Jesse 07/09/2018 ' intMATOpen = 50 - intOpenPR ' 10/4/2018 This is a new variable to take only 50% if openings for material yardage End If dblOPEN = Int(((Field2Double(moRS!opening) * intUSEOpen) / 100) + 0.99) ' dblOPEN = Int((Field2Double(moRS!opening) * 0.5) + 0.99) ' changed to match one kote 10/12/2018 '**** August 20, 2011 - Jesse had me change labor to subtract 10 from lath '**** under 400 yds, 19 from lath labor on houses from 400 to 1000 '**** Also had me start taking openings off material yds on lots over 400 If moRSProj!use_open Then ' moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - 24 moRS!s_yds = (Field2Integer(dblNEWYDS) - dblOPEN) ' - 24 'Changed per Jesse 10/12/2018 If Field2Integer(dblNEWYDS) > 400 Then ' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) ' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 ' intDELETE = 19 ' changed to zero per Jesse 7/13/18 intDELETE = 0 moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) - intDELETE Else ' moRS!l_yds = (Field2Integer(dblnewyds) - dblOPEN) - 19 ' moRS!l_yds = (Field2Integer(dblNEWYDS)) - 5 'Change per Jesse 08/22/05 moRS!l_yds = (Field2Integer(dblNEWYDS) - dblOPEN) 'Change per Jesse 08/01/18 End If Else moRS!s_yds = Field2Integer(dblNEWYDS) 'Change per Jesse 08/01/18 ' moRS!s_yds = Field2Integer(dblNEWYDS) - 5 If Field2Integer(dblNEWYDS) > 400 Then ' intDELETE = Int((Field2Integer(dblnewyds) * 0.06) + 0.99) ' intDELETE = Int((Field2Integer(dblNEWYDS) * 0.05) + 0.99) 'Change for Jesse 06/14/2005 ' intDELETE = 19 ' changed to zero per Jesse 7/13/18 intDELETE = 0 moRS!l_yds = Field2Integer(dblNEWYDS) - intDELETE Else moRS!l_yds = Field2Integer(dblNEWYDS) 'Change per Jesse 08/01/18 ' moRS!l_yds = Field2Integer(dblNEWYDS) - 5 End If End If strSQL = "DELETE * FROM tblLotMatrl WHERE RC_Flag and not CH_Flag and lot_id = " & gintLOTID goConn.Execute strSQL strSELECT = "SELECT * FROM tblLotMatrl where lot_id = " & gintLOTID Set moRSCMat = New Recordset moRSCMat.Open strSELECT, goConn, adOpenKeyset, adLockOptimistic If txtSuperRL = -1 Then strSQL = "DELETE * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and inv_no = '1330'" goConn.Execute strSQL End If If txtSuperRL > 0 Then dblRL = CInt(txtSuperRL) moRSCMat.MoveFirst strSELECT = "inv_no = '1330'" moRSCMat.Find strSELECT If moRSCMat.EOF Then moRSCMat.MovePrevious strGET = "SELECT * FROM tblInvtry where inv_no = '1330'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = "1330" moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) ' moRSCMat!rc_flag = vbChecked moRSCMat!qty = Field2Str(txtSuperRL) moRSCMat!ch_flag = vbChecked moRSCMat.Update Else moRSCMat!qty = Field2Str(txtSuperRL) moRSCMat!ch_flag = vbChecked moRSCMat.Update End If End If 'Black Board If txtSuperBB > 0 Then dblBB = CInt(txtSuperBB) Else moRSCMat.MoveFirst strSELECT = "inv_no = '1310'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then dblBB = Field2Str(moRSCMat!qty) Else dblBB = 0 End If End If moRSCMat.MoveFirst strSELECT = "inv_no = '1310'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then moRSCMat.Delete Else moRSCMat.MoveFirst strSELECT = "inv_no = '1315'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then moRSCMat.Delete End If End If If moRSProj!rg1 Then moRSCMat.MoveFirst strSELECT = "inv_no = '1317'" moRSCMat.Find strSELECT If Not moRSCMat.EOF Then moRSCMat.Delete End If End If If txtSuperBB = -1 Then Else If moRSProj!bb Then strGET = "SELECT * FROM tblInvtry where inv_no = '1310'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!qty = Field2Str(txtSuperBB) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbChecked moRSCMat.Update strSELECT = "inv_no = '1310'" moRSCMat.Find strSELECT dblBB = Field2Str(moRSCMat!qty) Else If moRSProj!rg12 Then strGET = "SELECT * FROM tblInvtry where inv_no = '1315'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!qty = Field2Str(txtSuperBB) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbChecked moRSCMat.Update strSELECT = "inv_no = '1315'" moRSCMat.Find strSELECT dblBB = Field2Str(moRSCMat!qty) ElseIf moRSProj!rg1 Then strGET = "SELECT * FROM tblInvtry where inv_no = '1317'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!qty = Field2Str(txtSuperBB) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!ch_flag = vbChecked moRSCMat.Update strSELECT = "inv_no = '1317'" moRSCMat.Find strSELECT dblBB = Field2Str(moRSCMat!qty) End If End If End If 'Stucco Wire 'Paperback wire If mstrWIRE = "P" Then dblWire = Field2Integer(mstrWireAdj) If txtSuperSP > 0 Then dblSP = Field2Str(txtSuperSP) Else dblSP = 0 End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1450' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1450'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked If dblRL > 10 Then dblARL = Int(((dblRL - 10) * 1.77) + 0.99) Else dblARL = 0 ' dblARL = Int(((dblRL) * 1.77) + 0.99) End If dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.49) ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 33) + 0.99) ' Changed per Jesse 12/11/17 moRSCMat!qty = dblCALC moRSCMat.Update dblCALC = 0 End If End If 'Self Furing wire If mstrWIRE = "F" Then ' If dblSP > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1417' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1417'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked ' dblCALC = Int(((dblSP * 3.5) / 45) + 0.99) ' dblCALC = Int(((dblSP * 3.5) / 50) + 0.99) dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.49) ' dblCALC = Int(((CDbl(txtTtlYdge) - (dblSP * 3.5) - dblARL - dblWire) / 45) + 0.99) 'CHanged per Jesse 12/11/17 moRSCMat!qty = dblCALC moRSCMat.Update dblCALC = 0 End If End If 'Black Paper If txtSuperSP > 0 Then dblSP = CDbl(txtSuperSP) Else dblSP = 0 End If ' If moRSProj!bp_type = "B6" Then 'cover entire house once plus sheer and BB ' If moRSProj!bb Then ' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5) + (dblBB * 3.5)) / 20) + 0.99) ' Else ' dblBP = Int(((CDbl(dblNEWYDS) + (dblSP * 3.5)) / 20) + 0.99) ' End If ' End If ' If dblSP > 0 Then If moRSProj!bp_type = "B6" Then If dblSP > 0 Then dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 20) dblBP = dblBP + (((dblSP * 3.5) / 20) * 2) dblBP = Int(dblBP + 0.99) Else dblBP = Int((Field2Integer(dblNEWYDS) / 20) + 0.99) End If ElseIf moRSProj!bp_type = "B7" Then If dblSP > 0 Then dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 16) dblBP = dblBP + (((dblSP * 3.5) / 16)) ' dblBP = dblBP + (((dblSP * 3.5) / 16) * 2) dblBP = Int(dblBP + 0.99) Else dblBP = Int((Field2Integer(dblNEWYDS) / 16) + 0.99) End If ElseIf moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then If dblSP > 0 Then dblBP = ((Field2Integer(dblNEWYDS) - (dblSP * 3.5)) / 33) dblBP = dblBP + (((dblSP * 3.5) / 33) * 2) dblBP = Int(dblBP + 0.99) Else dblBP = Int((Field2Integer(dblNEWYDS) / 33) + 0.99) End If End If If moRSProj!bp_type = "B6" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1809' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1809'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update End If End If If moRSProj!bp_type = "B7" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1811' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1811'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update End If End If If moRSProj!bp_type <> "B6" Or moRSProj!bp_type <> "B7" Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '1810' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1810'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblBP moRSCMat.Update End If End If 'Calculate 1 Kote, Cement, Lime, and Sand for the Current House strGET = "SELECT * FROM tblTCInfo" Set oRST = New Recordset oRST.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3110' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '3110'" 'Plastic Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = "S" moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 700) + 0.99) moRSCMat.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '3220' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '3220'" 'Red Tape Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = "S" moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int((Field2Integer(dblNEWYDS) / 150) + 0.99) moRSCMat.Update End If 'Scratch Coat dblBatch = Int((dblNEWYDS / oRST!scr_yd) + 0.99) dblSCmnt = (dblBatch * oRST!scr_cmnt) dblSLime = (dblBatch * oRST!scr_lime) dblRS = (dblBatch * oRST!scr_rs) 'Brown Coat dblBatch = Int((dblNEWYDS / oRST!brn_yd) + 0.99) dblCMNT = (dblBatch * oRST!brn_cmnt) dblLime = (dblBatch * oRST!brn_lime) dblRS = dblRS + (dblBatch * oRST!brn_rs) 'Texture Coat 'This caluclates the materials needed for the primary texture strGET = "SELECT * FROM tblFinish where ID = '" & Field2Str(moRS!texture) & "'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly strFIN2 = Field2Str(oRSC!Secondary) strFIN1 = Field2Str(oRSC!Primary) If moRS!fin2 > 0 Then If oRSC!Secondary = "" Or IsNull(oRSC!Secondary) Then ' If moRS!texture = "SK" Or moRS!texture = "DA" Or moRS!texture = "SA" Or moRS!texture = "SM" Or moRS!texture = "QU" Or moRS!texture = "MN" Then moRS!fin2 = 0 moRS.Update End If End If dblBatch = Int((((Field2Integer(dblNEWYDS) - 10) - Field2Integer(moRS!fin2)) / Field2Integer(oRSC!yds)) + 0.99) If Field2Str(oRSC!id) = "SB" Then dblSYN = Int((((Field2Integer(dblNEWYDS) - 10) * 9) / Field2Integer(oRSC!yds)) + 0.5) ' dblSYN = Int(dblBatch + 0.5) End If If Field2Integer(oRSC!cmnt) > 0 Then dblTCMNT = Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) Else dblTCMNT = 0 End If If Field2Integer(oRSC!lime) > 0 Then dblTLime = Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) Else dblTLime = 0 End If If Field2Integer(oRSC!s16) > 0 Then dblS16 = Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) Else dblS16 = 0 End If If Field2Integer(oRSC!s20) > 0 Then dblS20 = Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) Else dblS20 = 0 End If If Field2Integer(oRSC!s30) > 0 Then dblS30 = Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) Else dblS30 = 0 End If If Field2Integer(oRSC!trs) > 0 Then dblRS = dblRS + ((dblBatch * Field2Integer(oRSC!trs)) + Field2Integer(oRSC!xrs)) ' Else ' dblRS = 0 End If 'This calculates the additional materials needed for the second texture If moRS!fin2 > 0 Then strGET = "SELECT * FROM tblFinish where ID = '" & strFIN2 & "'" Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockReadOnly dblBatch = Int((Field2Integer(moRS!fin2) / Field2Integer(oRSC!yds)) + 0.99) If Field2Str2(oRSC!cmnt) > 0 Then dblTCMNT = dblTCMNT + Int((dblBatch * Field2Str2(oRSC!cmnt)) + 0.99) ' Else ' dblTCMNT = 0 End If If Field2Str2(oRSC!lime) > 0 Then dblTLime = dblTLime + Int((dblBatch * Field2Str2(oRSC!lime)) + 0.99) ' Else ' dblTLime = 0 End If If Field2Integer(oRSC!s16) > 0 Then dblS16 = dblS16 + Int((dblBatch * Field2Integer(oRSC!s16)) + 0.99) ' Else ' dblS16 = 0 End If If Field2Integer(oRSC!s20) > 0 Then dblS20 = dblS20 + Int((dblBatch * Field2Integer(oRSC!s20)) + 0.99) ' Else ' dblS20 = 0 End If If Field2Integer(oRSC!s30) > 0 Then dblS30 = dblS30 + Int((dblBatch * Field2Integer(oRSC!s30)) + 0.99) ' Else ' dblS30 = 0 End If End If dblRS = Int((dblRS / 2000) + 0.99) If dblSYN > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2600' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2600'" 'EIFS SANDBLAST Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblSYN moRSCMat.Update End If strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2610' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2610'" 'EIFS SANDBLAST Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Int((dblSYN / 10) + 0.5) moRSCMat.Update End If End If If moRSProj!plcmnt Then 'Calculate Plastic Cement If dblCMNT > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2414' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2414'" 'Brown Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblCMNT moRSCMat.Update End If End If If dblSCmnt > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2415' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2415'" 'Scratch Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblSCmnt moRSCMat.Update End If End If If dblTCMNT > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2414' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2414'" 'Texture Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblTCMNT moRSCMat.Update End If End If Else If dblCMNT > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2411' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2411'" 'Brown Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblCMNT moRSCMat.Update End If End If If dblSCmnt > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2412' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2412'" 'Scratch Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblSCmnt moRSCMat.Update End If End If If dblTCMNT > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2410' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2410'" 'Texture Cement Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblTCMNT moRSCMat.Update End If End If End If If dblLime > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2431' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2431'" 'Brown Lime Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblLime moRSCMat.Update End If End If If dblSLime > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2432' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2432'" 'Scratch Lime Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Str(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblSLime moRSCMat.Update End If End If If dblTLime > 0 Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2430' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2430'" 'Texture Lime Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblTLime moRSCMat.Update End If End If If dblS16 > 0 Then If moRSProj!silica Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2316' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2316'" 'Silica 16 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS16 moRSCMat.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2366' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2366'" 'Marble Sand 16 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS16 moRSCMat.Update End If End If End If If dblS20 > 0 Then If moRSProj!silica Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2320' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2320'" 'Silica 20 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS20 moRSCMat.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2370' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2370'" 'Marble Sand 20 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS20 moRSCMat.Update End If End If End If If dblS30 > 0 Then If moRSProj!silica Then strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2330' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2330'" 'Silica 30 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS30 moRSCMat.Update End If Else strSql2 = "SELECT * FROM tblLotMatrl WHERE inv_no = '2380' and lot_id = " & gintLOTID Set oRC = New Recordset oRC.Open strSql2, goConn, adOpenForwardOnly, adLockOptimistic If oRC.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '2380'" 'Marble Sand 30 Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = dblS30 moRSCMat.Update End If End If End If If dblRS > 0 Then txtSand = dblRS End If 'Calculate 4d Nails strSELECT = "inv_no = '1616'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then moRSCMat!qty = Round((Field2Str(dblNEWYDS) / 400) + 0.05, 1) moRSCMat.Update End If End If 'Calculate Staples strSELECT = "inv_no = '1705'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then If Field2Integer(dblNEWYDS) <= 250 Then moRSCMat!qty = 1 Else moRSCMat!qty = Round(((Field2Integer(dblNEWYDS) / 250) + 0.05), 1) End If End If moRSCMat.Update End If 'Rapid Staples strSELECT = "inv_no = '1730'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then If Field2Integer(dblNEWYDS) <= 400 Then moRSCMat!qty = 1 ElseIf Field2Integer(dblNEWYDS) > 400 And Field2Integer(dblNEWYDS) <= 700 Then moRSCMat!qty = 2 ElseIf Field2Integer(dblNEWYDS) > 700 And Field2Integer(dblNEWYDS) <= 1000 Then moRSCMat!qty = 3 ElseIf Field2Integer(dblNEWYDS) > 1000 And Field2Integer(dblNEWYDS) <= 1300 Then moRSCMat!qty = 4 ElseIf Field2Integer(dblNEWYDS) > 1300 And Field2Integer(dblNEWYDS) <= 1600 Then moRSCMat!qty = 5 ElseIf Field2Integer(dblNEWYDS) > 1600 And Field2Integer(dblNEWYDS) <= 1900 Then moRSCMat!qty = 6 ElseIf Field2Integer(dblNEWYDS) > 1900 And Field2Integer(dblNEWYDS) <= 2200 Then moRSCMat!qty = 7 ElseIf Field2Integer(dblNEWYDS) > 2200 And Field2Integer(dblNEWYDS) <= 2500 Then moRSCMat!qty = 8 ElseIf Field2Integer(dblNEWYDS) > 2500 And Field2Integer(dblNEWYDS) <= 2800 Then moRSCMat!qty = 9 ElseIf Field2Integer(dblNEWYDS) > 2800 And Field2Integer(dblNEWYDS) <= 3100 Then moRSCMat!qty = 10 End If End If moRSCMat.Update End If 'Latex Caulking strSELECT = "inv_no = '1820'" moRSCMat.MoveFirst moRSCMat.Find strSELECT If Not moRSCMat.EOF Then If Not moRSCMat!ch_flag Then moRSCMat!qty = Int(((Field2Integer(dblNEWYDS) / 100) * 1.5) + 0.99) moRSCMat.Update End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module MatCalcThree" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub ConvertSuper() Dim strGET As String, strSQL As String Dim oRSC As Recordset On Error GoTo Error_EH If txtSuper78 <> 0 Then strSQL = "inv_no = '1150'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1120'" '78 JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper78) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper78) moRSCMat.Update End If End If If txtSuper38 <> 0 Then strSQL = "inv_no = '1150'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1150'" '38 JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper38) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper38) moRSCMat.Update End If End If If txtSuper783 <> 0 Then If moRSProj!zmetal Then strSQL = "inv_no = '1145'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1145'" '78x3 JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper783) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper783) moRSCMat.Update End If End If If moRSProj!FHA Then strSQL = "inv_no = '1565'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1565'" '78x3 FHA JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper783) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper783) moRSCMat.Update End If Else strSQL = "inv_no = '1140'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1140'" '78x3 JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper783) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper783) moRSCMat.Update End If End If End If If txtSuperML <> 0 Then strSQL = "inv_no = '1370'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1370'" 'Metal Lath Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuperML) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuperML) moRSCMat.Update End If End If If txtSuperDW <> 0 Then strSQL = "inv_no = '1320'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then strGET = "SELECT * FROM tblInvtry where inv_no = '1320'" 'Drywall Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuperDW) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuperDW) moRSCMat.Update End If End If ' If Field2Str2(txtSuper1383) <> 0 Then If (txtSuper1383) <> 0 Then If moRSProj!zmetal Then strSQL = "inv_no = '1135'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then moRSCMat.MovePrevious strGET = "SELECT * FROM tblInvtry where inv_no = '1135'" '138X3 JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper1383) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper1383) moRSCMat.Update End If End If If moRSProj!FHA Then strSQL = "inv_no = '1130'" moRSCMat.MoveFirst moRSCMat.Find strSQL If Not moRSCMat.EOF Then moRSCMat.Delete End If strSQL = "inv_no = '1570'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then moRSCMat.MovePrevious strGET = "SELECT * FROM tblInvtry where inv_no = '1570'" '138X3 FHA JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper1383) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper1383) moRSCMat.Update End If Else strSQL = "inv_no = '1570'" moRSCMat.MoveFirst moRSCMat.Find strSQL If Not moRSCMat.EOF Then moRSCMat.Delete End If strSQL = "inv_no = '1130'" moRSCMat.MoveFirst moRSCMat.Find strSQL If moRSCMat.EOF Then moRSCMat.MovePrevious strGET = "SELECT * FROM tblInvtry where inv_no = '1130'" '138X3 JMB Set oRSC = New Recordset oRSC.Open strGET, goConn, adOpenForwardOnly, adLockOptimistic moRSCMat.AddNew moRSCMat!LOT_ID = gintLOTID moRSCMat!inv_no = Field2Integer(oRSC!inv_no) moRSCMat!Desc = Field2Str(oRSC!Desc) moRSCMat!d_flag = Field2Str(oRSC!d_flag) moRSCMat!m_type = Field2Str(oRSC!m_type) moRSCMat!calc_flag = Field2Str(oRSC!calc_flag) moRSCMat!calc_amt = Field2Integer(oRSC!calc_amt) moRSCMat!rc_flag = vbChecked moRSCMat!qty = Str2Field(txtSuper1383) moRSCMat.Update Else moRSCMat!qty = Str2Field(txtSuper1383) moRSCMat.Update End If End If End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module ConvertSuper" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub CalcMetal() Dim oRS As Recordset Dim strSQL As String, dblMETAL As Double On Error GoTo Error_EH moRS!METAL = 0 strSQL = "SELECT SUM(qty * calc_amt) as SUMmetal FROM tblLotMatrl where calc_flag = 'M' and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly dblMETAL = Field2Str2(oRS!summetal) moRS!METAL = dblMETAL moRS!calcdate = Now ' moRS!calcdate = Date moRS.Update txtMetal = dblMETAL oRS.Close Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module CalcMetal" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub txtSuperSP_LostFocus() txtSuperSP = Integer2Field(txtSuperSP) End Sub Private Sub txtYardMemo_LostFocus() txtYardMemo = UCase(txtYardMemo) End Sub Private Sub PrintLathInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim oRSE As Recordset, strTEST As String Dim strSQLE As String, strSQLINFO As String Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String, intNMonth As Integer Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim intDUE1 As Integer, intDUE2 As Integer Dim dblBillAmt As Double, dblWAmt As Double On Error GoTo Error_EH ' If moRSProj!Wrap Then ' mboolWRAP = True ' Else ' mboolWRAP = False ' End If gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If Set oRS = New Recordset ' oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic ' oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic oRS.Open strSQL, goConn, adOpenDynamic, adLockPessimistic If Not oRS.EOF Then End If strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSE.EOF Then If oRSE!Wrap Then mboolWRAP = True 'Check this logic in other Print Invoice areas Else mboolWRAP = False End If End If If moRSProj!cocode = 0 Then strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" ElseIf moRSProj!cocode = 1 Then strSQL4 = "SELECT * FROM tblARMasterM where Cust_no = '" & Field2Str(moRSProj!ar) & "'" End If Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 gstrMODULE = "Line 28 " With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "L" !ship_date = Field2Str(moRS!lorder) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !customer_no = Field2Str(moRSProj!ar) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) ' If IsNumeric(moRS!lot_no) Then If IsNumeric(moRS!lot_no) And IsNumeric(moRSProj!inv) Then ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str2(moRS!lot_no), "000") & "L" ' mstrINV = Field2Str(moRSProj!inv) & Format(CSng(Field2Str2(moRS!lot_no)), "###") & "L" strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" mstrINV = Field2Str(moRSProj!inv) & Trim$(Field2Str(moRS!lot_no)) & "L" ' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "L" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" End If intNMonth = Month(Date) intCMonth = Month(moRS!lorder) intCDay = Day(moRS!lorder) intCYear = Year(moRS!lorder) ' If mbool2Dates Then ' intDUE1 = Integer2Field(moRSProj!duedate) ' intDUE2 = Integer2Field(moRSProj!duedate2) ' Else ' intDUE1 = Integer2Field(moRSProj!duedate) ' End If If intCDay > moRSProj!inv_due Then If mbool2Dates Then ' If intCDay > intDUE1 And intCDay < intDUE2 Then If intCDay > intDUE1 And intNMonth = intCMonth Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If ' intCDay = Field2Integer(moRSProj!inv_due) intCDay = intDUE1 If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If ElseIf intCDay > intDUE2 Or intCDay < intDUE1 Then '' ElseIf intCDay > intDUE1 And intCDay > intDUE2 Then If intCDay > intDUE1 Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If ' intCDay = Field2Integer(moRSProj!inv_due) intCDay = intDUE1 If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If End If '***May Be An Extra End If Else If intCDay > intDUE1 Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If ' intCDay = Field2Integer(moRSProj!inv_due) intCDay = intDUE1 If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear ' !invoice_date = Field2Str(strCDate) ' moRS!PRNT_L = Field2Str(strCDate) ' moRS.Update !invoice_date = DateAdd("d", 3, moRS!lorder) !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If intDay = Day(moRS!lorder) ' intDay = intDay + 30 ' intDay = Field2Integer(moRSProj!duedate) ' Changed 04/26/2017 to try to simplify dates on invoices ' If intDay = 0 Then ' intDay = 1 ' End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = DateAdd("d", 33, moRS!lorder) ' !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!lorder) !non_tax_amt = Field2Str2(oRSE!l_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) dblBillAmt = Val(oRSE!l_bill) !sales_code = Field2Str(oRSE!l_code) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) !price = Field2Str2(oRSE!l_bill) !amount = Field2Str2(oRSE!l_bill) !invoice_no = mstrINV !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update gstrMODULE = "After Main Lath Information " strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With gstrMODULE = "After Trans ID Update Information " '*****Project not marked to bill options with Stucco '*****Options will be billed with Lath If Not moRSProj!opt Then strSQL1 = "SELECT * FROM tblLOption where (not ostone or not invoice) and lot_id = " & gintLOTID Set oRSO = New Recordset oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly Do Until oRSO.EOF strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" ' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) Set oRSP = New Recordset oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSP.EOF Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "L" !ship_date = Field2Str(moRS!lorder) !customer_no = Field2Str(moRSProj!ar) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "L" Else !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" End If intCMonth = Month(moRS!lorder) intCDay = Day(moRS!lorder) intCYear = Year(moRS!lorder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) ' moRS!PRNT_L = Field2Str(strCDate) ' moRS.Update ' !invoice_date = DateAdd("d", 3, moRS!lorder) !disc_due_date = DateAdd("d", 3, moRS!lorder) !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If intDay = Day(moRS!lorder) ' intDay = intDay + 30 ' intDay = Field2Integer(moRSProj!duedate) ' Changed 04/26/2018 to try and simplify dates ' If intDay = 0 Then ' intDay = 1 ' End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = DateAdd("d", 33, moRS!lorder) ' !inv_due_date = Field2Str(strDate) !non_tax_amt = Field2Str2(oRSP!Amt) dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) !sales_code = Field2Str(oRSP!b_code) !Description = Field2Str(oRSP!Desc) !Quantity = 1 !price = Field2Str2(oRSP!Amt) !amount = Field2Str2(oRSP!Amt) !header = vbUnchecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With oRSP.MoveNext End If oRSO.MoveNext Loop End If '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen If mboolWRAP Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "L" !ship_date = Field2Str(moRS!lorder) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !customer_no = Field2Str(moRSProj!ar) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) !invoice_no = strTEST2 mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "L" !invoice_date = DateAdd("d", 3, moRS!lorder) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!lorder) ' !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!lorder) !non_tax_amt = Field2Str2(oRSE!l_bill) dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) dblINVTOTAL = dblINVTOTAL + dblBillAmt ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* !sales_code = "WINS" If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "WRAP INS CREDIT " & Field2Str(oRSE!Mod_Elv) !price = dblBillAmt !amount = dblBillAmt !invoice_no = mstrINV !header = vbUnchecked ' !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update gstrMODULE = "After Main Lath Information " strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With End If gstrMODULE = "After Option Information " If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'L' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'L' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic gstrMODULE = "After Open for Totals Setup " Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop gstrMODULE = "After Totals Setup " If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If ' strSELECT = "{tblARInvoice.invoice_no} = '" & mstrINV & "'" ' crOrder.ReportFileName = App.Path & "\invoice.rpt" crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = gstrMODULE & "Form LotInfo - Module PrintLathInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintCompleteInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double, strSQLINFO As String Dim strADD3 As String, strADD4 As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim dblBillAmt As Double, dblWAmt As Double, oRSE As Recordset, strSQLE As String On Error GoTo Error_EH gintCOPY = 1 strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & moRS!est_id ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSC.EOF Then If Field2Str(oRSC!Address2) = "" Then strADD3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else strADD3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then strADD4 = "" Else strADD4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If End If dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 If oRS.EOF Then End If With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "C" !ship_date = Val(Field2Str2(moRS!forder)) ' !ship_date = Val(Field2Str2(moRS!SORDER)) !customer_no = Field2Str(moRSProj!ar) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "C" End If strCDate = DateAdd("d", 3, moRS!forder) ' strCDate = DateAdd("d", 3, moRS!SORDER) !invoice_date = Field2Str(strCDate) !job_number = Field2Str(moRS!jobcost) strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear ' !inv_due_date = Field2Str(strDate) !inv_due_date = DateAdd("d", 33, moRS!forder) !disc_due_date = DateAdd("d", 3, moRS!forder) ' !inv_due_date = DateAdd("d", 33, moRS!SORDER) ' !disc_due_date = DateAdd("d", 3, moRS!SORDER) !non_tax_amt = Field2Str2(oRSE!s_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) dblBillAmt = Val(oRSE!s_bill) !sales_code = Field2Str(oRSE!s_code) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "STUCCO & LATH COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) !price = Field2Str2(oRSE!s_bill) !amount = Field2Str2(oRSE!s_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) !c_add3 = strADD3 !c_add4 = strADD4 Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With strSQL1 = "SELECT * FROM tblLOption where (not ostone and not invoice) and lot_id = " & gintLOTID Set oRSO = New Recordset oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly If oRS.EOF Then End If Do Until oRSO.EOF strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!Opt_ID) Set oRSP = New Recordset oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSP.EOF Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "C" !ship_date = Field2Str(moRS!forder) ' !ship_date = Field2Str(moRS!SORDER) !customer_no = Field2Str(moRSProj!ar) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "C" !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" Else !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "C" End If strCDate = DateAdd("d", 3, moRS!forder) ' strCDate = DateAdd("d", 3, moRS!SORDER) !invoice_date = Field2Str(strCDate) ' !invoice_date = DateAdd("d", 3, moRS!SORDER) !disc_due_date = DateAdd("d", 3, moRS!forder) ' !disc_due_date = DateAdd("d", 3, moRS!SORDER) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!forder) ' !inv_due_date = DateAdd("d", 33, moRS!SORDER) ' !inv_due_date = Field2Str(strDate) !non_tax_amt = Field2Str2(oRSP!Amt) dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSP!Amt)) dblBillAmt = dblBillAmt + Val(Field2Str2(oRSP!Amt)) !sales_code = Field2Str(oRSP!b_code) !Description = Field2Str(oRSP!Desc) !Quantity = 1 !price = Field2Str2(oRSP!Amt) !amount = Field2Str2(oRSP!Amt) !header = vbUnchecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) !c_add3 = strADD3 !c_add4 = strADD4 Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update End With strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update oRSO.MoveNext End If Loop '********************************************************************************************************* '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen If mboolWRAP Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "S" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) !invoice_no = strTEST2 mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" strCDate = DateAdd("d", 3, moRS!forder) !invoice_date = Field2Str(strCDate) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!forder) !disc_due_date = DateAdd("d", 3, moRS!forder) !non_tax_amt = Field2Str2(oRSE!s_bill) ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) dblINVTOTAL = dblINVTOTAL + dblBillAmt ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* !sales_code = "WINS" ' dblBillAmt = Val(oRSE!s_bill) !sales_code = Field2Str(oRSE!s_code) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) !price = dblBillAmt !amount = dblBillAmt !header = vbUnchecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With End If '********************************************************************************************************* If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'C' and Lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintCompleteInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStuccoInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim strTEST As String Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double ', mboolWRAP As Boolean Dim strADD3 As String, strADD4 As String, strSQLINFO As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim dblBillAmt As Double, dblWAmt As Double, oRSE As Recordset, strSQLE As String, strModELEV As String On Error GoTo Error_EH ' If moRSProj!Wrap Then ' mboolWRAP = True ' Else ' mboolWRAP = False ' End If gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly ' If oRSE.EOF Then ' End If ' Else If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If ' End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 gstrMODULE = "Before Add Inv To ARINVOICE" ' gstrMODULE = "Line 28 " With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "S" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown ' !ship_date = Field2Str(moRS!SORDER) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 '' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" '' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" End If '' intCMonth = Month(moRS!SORDER) '' intCDay = Day(moRS!SORDER) '' intCYear = Year(moRS!SORDER) ' intCMonth = Month(moRS!forder) ' intCDay = Day(moRS!forder) ' intCYear = Year(moRS!forder) ' If intCDay > moRSProj!inv_due Then ' intCMonth = intCMonth + 1 ' If intCMonth > 12 Then ' intCMonth = intCMonth - 12 ' intCYear = intCYear + 1 ' End If ' End If intCDay = Field2Integer(moRSProj!inv_due) ' Invoice Date If intCDay = 0 Then intCDay = Day(moRS!forder) End If strCDate = DateAdd("d", 3, moRS!forder) !invoice_date = Field2Str(strCDate) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!forder) !disc_due_date = DateAdd("d", 3, moRS!forder) !non_tax_amt = Field2Str2(oRSE!s_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) dblBillAmt = Val(oRSE!s_bill) !sales_code = Field2Str(oRSE!s_code) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If If chkSynthetic Then !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) Else !Description = "STUCCO COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) End If strModELEV = Field2Str(oRSE!Mod_Elv) !price = Field2Str2(oRSE!s_bill) !amount = Field2Str2(oRSE!s_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM gstrMODULE = "Before UPDATE of ARINVOICE Main Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With ' End If gstrMODULE = "Before Option Setup" If moRSProj!opt Then strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID Set oRSO = New Recordset oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly Do Until oRSO.EOF strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" ' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) Set oRSP = New Recordset oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSP.EOF Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "S" !ship_date = Field2Str(moRS!forder) ' !ship_date = Field2Str(moRS!SORDER) !customer_no = Field2Str(moRSProj!ar) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" Else !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" End If gstrMODULE = "During Option Setup for ARINVOICE" strCDate = DateAdd("d", 3, moRS!forder) !invoice_date = Field2Str(strCDate) !disc_due_date = DateAdd("d", 3, moRS!forder) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!forder) !non_tax_amt = Field2Str2(oRSP!Amt) dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) dblBillAmt = dblBillAmt + Val(oRSP!Amt) !sales_code = Field2Str(oRSP!b_code) !Description = Field2Str(oRSP!Desc) & " - " & strModELEV !Quantity = 1 !price = Field2Str2(oRSP!Amt) !amount = Field2Str2(oRSP!Amt) !header = vbUnchecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With End If oRSO.MoveNext Loop End If gstrMODULE = "Before Update mlngINVID second time" '********************************************************************************************************** '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen If mboolWRAP Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "S" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) !invoice_no = strTEST2 mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "S" strCDate = DateAdd("d", 3, moRS!forder) !invoice_date = Field2Str(strCDate) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!forder) !disc_due_date = DateAdd("d", 3, moRS!forder) !non_tax_amt = Field2Str2(oRSE!s_bill) ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) dblBillAmt = Round((dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1), 2) dblINVTOTAL = dblINVTOTAL + dblBillAmt ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* !sales_code = "WINS" ' dblBillAmt = Val(oRSE!s_bill) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) !price = dblBillAmt !amount = dblBillAmt !header = vbUnchecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With End If ' End If '*********************************************************************************************************** If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'S' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'S' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStuccoInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintStoneInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQLE As String, oRSE As Recordset Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String, strSQLINFO As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String, strModELEV As String Dim dblBillAmt As Double, dblWAmt As Double On Error GoTo Error_EH gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate <= #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly strModELEV = Field2Str(oRSE!Mod_Elv) If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly strSQL3 = "SELECT * FROM tblPOptBill WHERE est_id = " & Field2Long(moRS!est_id) & " AND B_code = 'VOPT' and effdate = #" & oRSE!effdate & "#" ' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = 'VOPT' and effdate = #" & oRSE!effdate & "#" ' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" ' strSQLB = "SELECT * FROM tblPlanBill WHERE Proj_ID = " & Field2Str2(moRSProj!Proj_ID) & " AND Mod_Elv = '" & mstrPLNELEV & "'" Set oRSO = New Recordset oRSO.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSO.EOF Then ' If IsNull(oRSO!B_code) Then mboolSTONE3 = True Else mboolSTONE3 = False ' End If End If dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 ' This has been changed to always pickup the Option Billing Info ' If Not mboolSTONE3 Then If mboolSTONE3 Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "V" !customer_no = Field2Str(moRSProj!ar) ' !ship_date = Field2Str(moRS!VOrder) !ship_date = (moRS!VOrder) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" ' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" ' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" Else ' strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" ' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" End If ' intCMonth = Month(moRS!VOrder) ' intCDay = Day(moRS!VOrder) ' intCYear = Year(moRS!VOrder) ' If intCDay > moRSProj!inv_due Then ' intCMonth = intCMonth + 1 ' If intCMonth > 12 Then ' intCMonth = intCMonth - 12 ' intCYear = intCYear + 1 ' End If ' End If ' intCDay = Field2Integer(moRSProj!inv_due) ' If intCDay = 0 Then ' Select Case intCMonth ' Case 2 ' intCDay = 28 ' Case 1, 3, 5, 7, 8, 10, 12 ' intCDay = 31 ' Case 4, 6, 9, 11 ' intCDay = 30 ' End Select ' End If ' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear strCDate = DateAdd("d", 3, moRS!VOrder) !invoice_date = Field2Str(strCDate) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!VOrder) !disc_due_date = DateAdd("d", 3, moRS!VOrder) !non_tax_amt = Field2Str2(oRSO!Amt) ' !non_tax_amt = Field2Str2(oRSE!st_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSO!Amt) dblBillAmt = Val(oRSO!Amt) ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) ' dblBillAmt = Val(oRSE!st_bill) !sales_code = Field2Str(oRSO!b_code) ' !sales_code = Field2Str(oRSE!st_code) ' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear ' !inv_due_date = Field2Str(strDate) ' !disc_due_date = DateAdd("d", 3, moRS!Vorder) ' !non_tax_amt = Field2Str2(oRSE!st_bill) ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!st_bill) ' !sales_code = Field2Str(oRSE!st_code) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "STONE COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) !price = Field2Str2(oRSO!Amt) !amount = Field2Str2(oRSO!Amt) ' !price = Field2Str2(oRSE!st_bill) ' !amount = Field2Str2(oRSE!st_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update '**** gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With End If '************************************************************************************************ '********** Print Options that are stone '' If moRSProj!opt Then ' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID '' strSQL1 = "SELECT * FROM tblLOption where ostone and lot_id = " & gintLOTID '' Set oRSO = New Recordset '' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly '' Do Until oRSO.EOF '' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" ' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) '' Set oRSP = New Recordset '' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly '' If Not oRSP.EOF Then '' With oRS '' .AddNew '' !Trans_ID = mlngINVID '' !Lot_id = gintLOTID '' !Proj_ID = gintPROJID '' !project = Field2Str(moRSProj!Proj_Desc) '' !lot_no = Field2Str(moRS!lot_no) '' !address = Field2Str(moRS!address) '' !inv_type = "S" ' !ship_date = Field2Str(moRS!vorder) '' !ship_date = (moRS!VOrder) ' !ship_date = Field2Str(moRS!SORDER) '' !customer_no = Field2Str(moRSProj!ar) '' !projcode = Field2Str(moRSProj!Proj_Code) '' !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) '' !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) '' If IsNumeric(moRS!lot_no) Then ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" '' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" '' Else '' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" '' End If '' gstrMODULE = "During Option Setup for ARINVOICE" '' strCDate = DateAdd("d", 3, moRS!VOrder) '' !invoice_date = Field2Str(strCDate) '' !disc_due_date = DateAdd("d", 3, moRS!VOrder) '' !job_number = Field2Str(moRS!jobcost) '' !inv_due_date = DateAdd("d", 33, moRS!VOrder) '' !non_tax_amt = Field2Str2(oRSP!amt) '' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!amt) '' dblBillAmt = dblBillAmt + Val(oRSP!amt) '' !sales_code = Field2Str(oRSP!b_code) '' !Description = Field2Str(oRSP!Desc) & " - " & strModELEV '' !Quantity = 1 '' !price = Field2Str2(oRSP!amt) '' !amount = Field2Str2(oRSP!amt) '' !header = vbUnchecked '' If Not oRSC.EOF Then '' !c_add1 = Field2Str(oRSC!Name) '' !c_add2 = Field2Str(oRSC!Address1) '' If Field2Str(oRSC!Address2) = "" Then '' !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) '' Else '' !c_add3 = Field2Str(oRSC!Address2) '' End If '' If Field2Str(oRSC!Address2) = "" Then '' !c_add4 = "" '' Else '' !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) '' End If '' Else '' !c_add1 = "" '' !c_add2 = "" '' !c_add3 = "" '' !c_add4 = "" '' End If '' !po_num = gstrPONUM '' .Update '' mlngINVID = mlngINVID + 1 '' strSQLINFO = "SELECT * FROM tblTABLE_INFO" '' Set moRSInvINFO = New Recordset '' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic '' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID '' moRSInvINFO.Update '' End With '' End If '' oRSO.MoveNext '' Loop '' End If '************************************************************************************************ '************************************************************************************************ '*****Check to see if this is a WRAP project and bill a credit for the cost of the wrap insurance '*****In billing grid, the percentage of deduction for Wrap Insurance will be seen If mboolWRAP Then With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "S" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) !invoice_no = strTEST2 ' mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "ST" strCDate = DateAdd("d", 3, moRS!VOrder) !invoice_date = Field2Str(strCDate) !job_number = Field2Str(moRS!jobcost) !inv_due_date = DateAdd("d", 33, moRS!VOrder) !disc_due_date = DateAdd("d", 3, moRS!VOrder) !non_tax_amt = Field2Str2(oRSE!st_bill) ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!s_bill) dblBillAmt = (dblBillAmt * (Val(Field2Str2(oRSE!WPctg)) / 100) * -1) dblINVTOTAL = dblINVTOTAL + dblBillAmt ' dblINVTOTAL = dblINVTOTAL + Val(oRSE!l_bill) '******* !sales_code = "WINS" ' dblBillAmt = Val(oRSE!s_bill) !sales_code = Field2Str(oRSE!st_code) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "WRAP INSURANCE CREDIT - " & Field2Str(oRSE!Mod_Elv) !price = dblBillAmt !amount = dblBillAmt !header = vbUnchecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM gstrMODULE = "Before UPDATE of ARINVOICE Wrap Credit Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With End If '************************************************************************************************ If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 moRS!st_flg = vbTrue moRS.Update Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintStoneInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPaintInvxx() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String On Error GoTo Error_EH gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblINVTOTAL = 0 dblRETENTION = 0 With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "P" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!VOrder) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" End If intCMonth = Month(moRS!VOrder) intCDay = Day(moRS!VOrder) intCYear = Year(moRS!VOrder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) ' !invoice_date = DateAdd("d", 3, moRS!vorder) !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 intDay = Field2Integer(moRSProj!duedate) If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!VOrder) !non_tax_amt = Field2Str2(oRSS!st_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) !sales_code = "STONE" If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) !price = Field2Str2(moRS!st_bill) !amount = Field2Str2(moRS!st_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 oRS.Close oRSS.Close oRSC.Close 'End of Interior Paint Invoice PI gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblINVTOTAL = 0 dblRETENTION = 0 With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "P" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!VOrder) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" End If intCMonth = Month(moRS!VOrder) intCDay = Day(moRS!VOrder) intCYear = Year(moRS!VOrder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) ' !invoice_date = DateAdd("d", 3, moRS!vorder) !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 intDay = Field2Integer(moRSProj!duedate) If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!VOrder) !non_tax_amt = Field2Str2(oRSS!st_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) !sales_code = "STONE" If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) !price = Field2Str2(moRS!st_bill) !amount = Field2Str2(moRS!st_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblINVTOTAL = 0 dblRETENTION = 0 With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "P" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!VOrder) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "V" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "V" End If intCMonth = Month(moRS!VOrder) intCDay = Day(moRS!VOrder) intCYear = Year(moRS!VOrder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) ' !invoice_date = DateAdd("d", 3, moRS!vorder) !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 intDay = Field2Integer(moRSProj!duedate) If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!VOrder) !non_tax_amt = Field2Str2(oRSS!st_bill) dblINVTOTAL = dblINVTOTAL + Val(oRSS!st_bill) !sales_code = "STONE" If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSS!Mod_Elv) !price = Field2Str2(moRS!st_bill) !amount = Field2Str2(moRS!st_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM .Update mlngINVID = mlngINVID + 1 moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'V' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'V' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPaintInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub JCSetup() Dim oRS As Recordset Dim strSQL As String On Error GoTo Error_EH If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblJCTrans" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblJCTransM" End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If IsNull(moRSProj!ar) Then MsgBox "There is no MAS90 AR Code for this Project so No Job Cost Record will be setup", vbOKOnly, "Fix & ReEnter" Exit Sub End If With oRS .AddNew !LOT_ID = gintLOTID !job_number = Field2Str(moRS!jobcost) !Desc = Trim(Left(Field2Str(moRSProj!Proj_Desc), 20)) & " LOT " & moRS!lot_no !address = Field2Str(moRS!address) !customer_no = Field2Str(moRSProj!ar) !retention_pct = Field2Str2(moRSProj!retention) !setup_date = Date !status_date = Date .Update End With MsgBox "Job Cost Record Has Been Setup For Transfer To MAS90", vbOKOnly, "Job Cost" Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module JCSetup" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub POInvoice() Dim strSELECT As String On Error GoTo Error_EH If moRS!st_flg Then MsgBox "This Lot Has Already Had A Stone Invoice Printed", vbOKOnly, "Invoice Not Available" Exit Sub End If gintCOPY = 1 strSELECT = "{tblPOrder.PONum} = " & lstPO.ItemData(lstPO.ListIndex) '************************************************************************************* testing Stone Invoice If optStone Then ' If optStucco Then Call PrintStoneInv Exit Sub End If '************************************************************************************* If moRSProj!cocode = 0 Then crOrder.ReportFileName = App.Path & "\invoicePO2.rpt" ElseIf moRSProj!cocode = 1 Then crOrder.ReportFileName = App.Path & "\invoicePO2M.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module POInvoice" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub ElevLoad() Dim oRS As Recordset, oRSS As Recordset Dim strSQL As String, strSql2 As String On Error GoTo Error_EH strSQL = "SELECT * FROM tblELEVATION WHERE Est_id = " & gintESTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic If Not oRS.EOF Then strSql2 = "DELETE * FROM tblLotElev where Lot_id = " & gintLOTID goConn.Execute strSql2 strSql2 = "SELECT * FROM tblLotELEV" ' & gintESTID Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRSS.AddNew oRSS!LOT_ID = gintLOTID oRSS!Folder = oRS!Folder oRSS!FileName = oRS!FileName oRSS!Primary = oRS!Primary oRSS.Update oRS.MoveNext Loop End If Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module ElevLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPaintIInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim oRSE As Recordset, strTEST As String Dim strSQLE As String Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String, strSQLINFO As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim dblBillAmt As Double, dblWAmt As Double '************* Needs to be added to LOTINFO5 ********************** '**** Logic to print the Paint Materials PO's needs to be designed ' Exit Sub On Error GoTo Error_EH gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly If oRSE.EOF Then End If If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 gstrMODULE = "Before Add Inv To ARINVOICE" ' gstrMODULE = "Line 28 " With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "PI" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown ' !ship_date = Field2Str(moRS!SORDER) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PI" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" End If ' intCMonth = Month(moRS!SORDER) ' intCDay = Day(moRS!SORDER) ' intCYear = Year(moRS!SORDER) intCMonth = Month(moRS!forder) intCDay = Day(moRS!forder) intCYear = Year(moRS!forder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) moRS!PNT_IDate = Date + 21 moRS.Update !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 intDay = Field2Integer(moRSProj!duedate) If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!forder) ' !disc_due_date = DateAdd("d", 3, moRS!SORDER) !non_tax_amt = Field2Str2(oRSE!pnt_bill) dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_bill)) !sales_code = Field2Str(oRSE!PNT_CODE) ' If IsNull(moRSProj!taxcode) Then ' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC ' Else ' !taxcode = "AZ" ' End If If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If ' If chkSynthetic Then ' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) ' Else !Description = "PAINT INTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) ' End If !price = Field2Str2(oRSE!pnt_bill) !amount = Field2Str2(oRSE!pnt_bill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM & "PI" gstrMODULE = "Before UPDATE of ARINVOICE Main Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With ' gstrMODULE = "Before Option Setup" ' If moRSProj!opt Then ' strSQL1 = "SELECT * FROM tblLOption where (Not ostone and not invoice) and lot_id = " & gintLOTID ' Set oRSO = New Recordset ' oRSO.Open strSQL1, goConn, adOpenForwardOnly, adLockReadOnly ' Do Until oRSO.EOF ' strSQL3 = "SELECT * FROM tblPOptBill WHERE optid = " & Field2Double(oRSO!Opt_ID) & " and effdate = #" & oRSE!effdate & "#" '' strSQL3 = "SELECT * FROM tblPOption WHERE optid = " & Field2Double(oRSO!opt_id) ' Set oRSP = New Recordset ' oRSP.Open strSQL3, goConn, adOpenForwardOnly, adLockReadOnly ' If Not oRSP.EOF Then ' With oRS ' .AddNew ' !Trans_ID = mlngINVID ' !Lot_id = gintLOTID ' !proj_id = gintPROJID ' !project = Field2Str(moRSProj!proj_desc) ' !lot_no = Field2Str(moRS!lot_no) ' !address = Field2Str(moRS!address) ' !inv_type = "S" ' !ship_date = Field2Str(moRS!forder) '' !ship_date = Field2Str(moRS!SORDER) ' !customer_no = Field2Str(moRSProj!ar) ' !projcode = Field2Str(moRSProj!proj_code) ' !CodeDesc = Trim(Field2Str(moRSProj!proj_code)) & "-" & Trim(Field2Str(moRSProj!proj_desc)) ' !ProjLot = Trim(Field2Str(moRSProj!proj_desc)) & " Lot " & Field2Str(moRS!lot_no) ' If IsNumeric(moRS!lot_no) Then '' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" ' Else ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" ' End If ' intCMonth = Month(moRS!forder) ' intCDay = Day(moRS!forder) ' intCYear = Year(moRS!forder) '' intCMonth = Month(moRS!SORDER) '' intCDay = Day(moRS!SORDER) '' intCYear = Year(moRS!SORDER) ' If intCDay > moRSProj!inv_due Then ' intCMonth = intCMonth + 1 ' If intCMonth > 12 Then ' intCMonth = intCMonth - 12 ' intCYear = intCYear + 1 ' End If ' End If ' intCDay = Field2Integer(moRSProj!inv_due) ' If intCDay = 0 Then ' Select Case intCMonth ' Case 2 ' intCDay = 28 ' Case 1, 3, 5, 7, 8, 10, 12 ' intCDay = 31 ' Case 4, 6, 9, 11 ' intCDay = 30 ' End Select ' End If ' gstrMODULE = "During Option Setup for ARINVOICE" ' strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear ' !invoice_date = Field2Str(strCDate) '' moRS!PRNT_S = Field2Str(strCDate) '' moRS.Update '' !invoice_date = DateAdd("d", 3, moRS!sorder) ' !disc_due_date = DateAdd("d", 3, moRS!forder) '' !disc_due_date = DateAdd("d", 3, moRS!SORDER) ' !job_number = Field2Str(moRS!jobcost) ' intYear = Year(!invoice_date) ' intMonth = Month(!invoice_date) + 1 ' If intMonth > 12 Then ' intMonth = intMonth - 12 ' intYear = intYear + 1 ' End If ' intDay = Field2Integer(moRSProj!duedate) '' If intDay = 0 Then '' intDay = 1 '' End If ' Select Case intMonth ' Case 2 ' If intDay = 0 Then ' intDay = 28 ' End If ' If intDay > 28 Then ' intDay = 28 ' End If ' Case 1, 3, 5, 7, 8, 10, 12 ' If intDay = 0 Then ' intDay = 31 ' End If ' If intDay > 31 Then ' intDay = 31 ' End If ' Case 4, 6, 9, 11 ' If intDay = 0 Then ' intDay = 30 ' End If ' If intDay > 30 Then ' intDay = 30 ' End If ' End Select ' strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear ' !inv_due_date = Field2Str(strDate) ' !non_tax_amt = Field2Str2(oRSP!Amt) ' dblINVTOTAL = dblINVTOTAL + Field2Str2(oRSP!Amt) ' !sales_code = Field2Str(oRSP!b_code) ' !Description = Field2Str(oRSP!Desc) ' !Quantity = 1 ' !price = Field2Str2(oRSP!Amt) ' !amount = Field2Str2(oRSP!Amt) ' !header = vbUnchecked ' If Not oRSC.EOF Then ' !c_add1 = Field2Str(oRSC!Name) ' !c_add2 = Field2Str(oRSC!address1) ' If Field2Str(oRSC!address2) = "" Then ' !c_add3 = Trim(Field2Str(oRSC!city)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!zipcode) ' Else ' !c_add3 = Field2Str(oRSC!address2) ' End If ' If Field2Str(oRSC!address2) = "" Then ' !c_add4 = "" ' Else ' !c_add4 = Trim(Field2Str(oRSC!city)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!zipcode) ' End If ' Else ' !c_add1 = "" ' !c_add2 = "" ' !c_add3 = "" ' !c_add4 = "" ' End If ' !po_num = gstrPONUM ' .Update ' mlngINVID = mlngINVID + 1 ' strSQLINFO = "SELECT * FROM tblTABLE_INFO" ' Set moRSInvINFO = New Recordset ' moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic ' moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID ' moRSInvINFO.Update ' End With ' End If ' oRSO.MoveNext ' Loop ' End If ' gstrMODULE = "Before Update mlngINVID second time" ' If Field2Integer(moRSProj!retention) > 0 Then ' dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") ' Else ' dblRETENTION = 0 ' End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PI' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PI' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PI'" ' strSELECT = "{tblARInvoice.Lot_ID} = '" & gintLOTID & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then ' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PI'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPaintInteriorInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPaintEInvxx() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim oRSE As Recordset, strTEST As String Dim strSQLE As String Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String, strSQLINFO As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String '************* Needs to be added to LOTINFO5 ********************** '**** Logic to print the Paint Materials PO's needs to be designed ' Exit Sub On Error GoTo Error_EH gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If If oRSE.EOF Then End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 gstrMODULE = "Before Add Inv To ARINVOICE" ' gstrMODULE = "Line 28 " With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "PE" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown ' !ship_date = Field2Str(moRS!SORDER) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" End If strCDate = DateAdd("d", 3, moRS!forder) ' strCDate = DateAdd("d", 3, moRS!VOrder) !invoice_date = Field2Str(strCDate) ' moRS!PNT_EDate = Field2Str(strCDate) moRS!PNT_EDate = Date + 21 moRS.Update ' !invoice_date = DateAdd("d", 3, moRS!sorder) !job_number = Field2Str(moRS!jobcost) strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & Format(intYear, "0000") !inv_due_date = strDate ' !inv_due_date = DateAdd("d", 3, moRS!VOrder) !disc_due_date = DateAdd("d", 3, moRS!forder) ' !disc_due_date = DateAdd("d", 3, moRS!SORDER) !non_tax_amt = Field2Str2(oRSE!pnt_ebill) dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_ebill)) !sales_code = Field2Str(oRSE!pnt_ecode) ' If IsNull(moRSProj!taxcode) Then ' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC ' Else ' !taxcode = "AZ" ' End If If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If ' If chkSynthetic Then ' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) ' Else !Description = "PAINT EXTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) ' End If !price = Field2Str2(oRSE!pnt_ebill) !amount = Field2Str2(oRSE!pnt_ebill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM & "PE" gstrMODULE = "Before UPDATE of ARINVOICE Main Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PE' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PE' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" ' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" ' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPaintExteriorInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPaintFInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim oRSE As Recordset, strTEST As String Dim strSQLE As String Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String, strSQLINFO As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String '************* Needs to be added to LOTINFO5 ********************** '**** Logic to print the Paint Materials PO's needs to be designed ' Exit Sub On Error GoTo Error_EH gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly If oRSE.EOF Then End If If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 gstrMODULE = "Before Add Inv To ARINVOICE" ' gstrMODULE = "Line 28 " With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "PF" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown ' !ship_date = Field2Str(moRS!SORDER) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PF" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" End If ' intCMonth = Month(moRS!SORDER) ' intCDay = Day(moRS!SORDER) ' intCYear = Year(moRS!SORDER) intCMonth = Month(moRS!forder) intCDay = Day(moRS!forder) intCYear = Year(moRS!forder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) moRS!PNT_FDate = Date + 21 ' moRS!PNT_FDate = Field2Str(strCDate) moRS.Update !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 intDay = Field2Integer(moRSProj!duedate) If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!forder) ' !disc_due_date = DateAdd("d", 3, moRS!SORDER) !non_tax_amt = Field2Str2(oRSE!pnt_fbill) dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_fbill)) !sales_code = Field2Str(oRSE!pnt_fcode) ' If IsNull(moRSProj!taxcode) Then ' !taxcode = Field2Str(moRSProj!taxcode) '****** FIX LOGIC ' Else ' !taxcode = "AZ" ' End If If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If ' If chkSynthetic Then ' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) ' Else !Description = "PAINT FINAL - PLAN " & Field2Str(oRSE!Mod_Elv) ' End If !price = Field2Str2(oRSE!pnt_fbill) !amount = Field2Str2(oRSE!pnt_fbill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM & "PF" gstrMODULE = "Before UPDATE of ARINVOICE Main Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With gstrMODULE = "Before Update mlngINVID second time" If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PF' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PF' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & " AND {tblARInvoice.Inv_Type} = 'PF'" ' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PF'" ' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPaintFinalInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub PrintPaintEInv() Dim oRS As Recordset, oRSS As Recordset, oRSO As Recordset, oRSP As Recordset, oRSC As Recordset Dim oRSE As Recordset, strTEST As String Dim strSQLE As String Dim strSQL As String, strSELECT As String, strSql2 As String, strSQL4 As String Dim strSQL1 As String, strSQL3 As String, intDay As Integer Dim intYear As Integer, intMonth As Integer, strDate As String Dim dblINVTOTAL As Double, dblRETENTION As Double Dim strADD3 As String, strADD4 As String, strSQLINFO As String Dim intCMonth As Integer, intCDay As Integer, strCDate As String, intCYear As Integer Dim strTEST2 As String, strMSG As String, strLEN As String Dim dblBillAmt As Double, dblWAmt As Double ', oRSE As Recordset, strSQLE As String '************* Needs to be added to LOTINFO5 ********************** '**** Logic to print the Paint Materials PO's needs to be designed ' Exit Sub On Error GoTo Error_EH gintCOPY = 1 If moRSProj!cocode = 0 Then strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT * FROM tblARINVOICEM where Trans_ID = 1" End If ' strSQL = "SELECT * FROM tblARINVOICE where Trans_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic strSql2 = "SELECT * FROM tblplans WHERE est_id = " & Field2Long(moRS!est_id) ' & "'" Set oRSS = New Recordset oRSS.Open strSql2, goConn, adOpenForwardOnly, adLockReadOnly strSQLE = "SELECT * FROM tblplanbill WHERE est_id = " & moRS!est_id & " and effdate < #" & moRS!startdate & "# ORDER BY effdate DESC" Set oRSE = New Recordset oRSE.Open strSQLE, goConn, adOpenForwardOnly, adLockReadOnly If oRSE.EOF Then End If If oRSE!Wrap Then mboolWRAP = True Else mboolWRAP = False End If strSQL4 = "SELECT * FROM tblARMaster where Cust_no = '" & Field2Str(moRSProj!ar) & "'" Set oRSC = New Recordset oRSC.Open strSQL4, goConn, adOpenForwardOnly, adLockReadOnly dblBillAmt = 0 dblINVTOTAL = 0 dblRETENTION = 0 gstrMODULE = "Before Add Inv To ARINVOICE" ' gstrMODULE = "Line 28 " With oRS .AddNew !Trans_ID = mlngINVID !LOT_ID = gintLOTID !Proj_ID = gintPROJID !project = Field2Str(moRSProj!Proj_Desc) !lot_no = Field2Str(moRS!lot_no) !address = Field2Str(moRS!address) !inv_type = "PE" !customer_no = Field2Str(moRSProj!ar) !ship_date = Field2Str(moRS!forder) 'Changed to allow printing with Brown ' !ship_date = Field2Str(moRS!SORDER) !projcode = Field2Str(moRSProj!Proj_Code) !CodeDesc = Trim(Field2Str(moRSProj!Proj_Code)) & "-" & Trim(Field2Str(moRSProj!Proj_Desc)) !ProjLot = Trim(Field2Str(moRSProj!Proj_Desc)) & " Lot " & Field2Str(moRS!lot_no) If IsNumeric(moRS!lot_no) Then strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" ' mstrINV = Field2Str(moRSProj!inv) & Format(Field2Str(moRS!lot_no), "000") & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" Else strTEST2 = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" strLEN = Len(strTEST2) If strLEN > 11 Then strMSG = "The Invoice Number Is Longer Than 11 Characters" & vbCrLf ' & vbCrLf strMSG = strMSG & "You Can Change It And Click Enter To Save It " & vbCrLf ' & vbCrLf strMSG = strMSG & "And Print The Invoice. If You Click On Cancel" & vbCrLf ' & vbCrLf strMSG = strMSG & "The Invoice Will Not Print AND You Will Not" & vbCrLf ' & vbCrLf strMSG = strMSG & "Receive An Invoice And You Will Not Be Able" & vbCrLf strMSG = strMSG & "To Go To The Next Step In Orders" & vbCrLf strMSG = strMSG & "Talk To The Billing Department If You Have Questions" strTEST2 = InputBox(strMSG, "Verify Invoice Length", strTEST2) If strTEST2 = "" Then Exit Sub End If End If !invoice_no = strTEST2 ' !invoice_no = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" mstrINV = Trim$(Field2Str(moRSProj!inv)) & Trim$(Field2Str(moRS!lot_no)) & "PE" ' mstrINV = Field2Str(moRSProj!inv) & Field2Str(moRS!lot_no) & "S" End If ' intCMonth = Month(moRS!SORDER) ' intCDay = Day(moRS!SORDER) ' intCYear = Year(moRS!SORDER) intCMonth = Month(moRS!forder) intCDay = Day(moRS!forder) intCYear = Year(moRS!forder) If intCDay > moRSProj!inv_due Then intCMonth = intCMonth + 1 If intCMonth > 12 Then intCMonth = intCMonth - 12 intCYear = intCYear + 1 End If End If intCDay = Field2Integer(moRSProj!inv_due) If intCDay = 0 Then Select Case intCMonth Case 2 intCDay = 28 Case 1, 3, 5, 7, 8, 10, 12 intCDay = 31 Case 4, 6, 9, 11 intCDay = 30 End Select End If strCDate = Format(intCMonth, "00") & "/" & Format(intCDay, "00") & "/" & intCYear !invoice_date = Field2Str(strCDate) moRS!PNT_EDate = Date + 21 ' moRS!PNT_FDate = Field2Str(strCDate) moRS.Update !job_number = Field2Str(moRS!jobcost) intYear = Year(!invoice_date) intMonth = Month(!invoice_date) + 1 intDay = Field2Integer(moRSProj!duedate) If intMonth > 12 Then intMonth = intMonth - 12 intYear = intYear + 1 End If Select Case intMonth Case 2 If intDay = 0 Then intDay = 28 End If If intDay > 28 Then intDay = 28 End If Case 1, 3, 5, 7, 8, 10, 12 If intDay = 0 Then intDay = 31 End If If intDay > 31 Then intDay = 31 End If Case 4, 6, 9, 11 If intDay = 0 Then intDay = 30 End If If intDay > 30 Then intDay = 30 End If End Select strDate = Format(intMonth, "00") & "/" & Format(intDay, "00") & "/" & intYear !inv_due_date = Field2Str(strDate) !disc_due_date = DateAdd("d", 3, moRS!forder) ' !disc_due_date = DateAdd("d", 3, moRS!SORDER) !non_tax_amt = Field2Str2(oRSE!pnt_ebill) dblINVTOTAL = dblINVTOTAL + Val(Field2Str2(oRSE!pnt_ebill)) !sales_code = Field2Str(oRSE!pnt_ecode) If IsNull(moRSProj!taxcode) Or moRSProj!taxcode = "" Then !taxcode = "AZ" Else !taxcode = Field2Str(moRSProj!taxcode) End If ' If chkSynthetic Then ' !Description = "SYNTHETIC COMPLETE - PLAN " & Field2Str(oRSE!Mod_Elv) ' Else !Description = "PAINT EXTERIOR - PLAN " & Field2Str(oRSE!Mod_Elv) ' End If !price = Field2Str2(oRSE!pnt_ebill) !amount = Field2Str2(oRSE!pnt_ebill) !header = vbChecked If Not oRSC.EOF Then !c_add1 = Field2Str(oRSC!Name) !c_add2 = Field2Str(oRSC!Address1) If Field2Str(oRSC!Address2) = "" Then !c_add3 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) Else !c_add3 = Field2Str(oRSC!Address2) End If If Field2Str(oRSC!Address2) = "" Then !c_add4 = "" Else !c_add4 = Trim(Field2Str(oRSC!City)) & ", " & Field2Str(oRSC!State) & " " & Field2Str(oRSC!ZipCode) End If Else !c_add1 = "" !c_add2 = "" !c_add3 = "" !c_add4 = "" End If !po_num = gstrPONUM & "PE" gstrMODULE = "Before UPDATE of ARINVOICE Main Line" .Update gstrMODULE = "Before mlngINVID update" mlngINVID = mlngINVID + 1 strSQLINFO = "SELECT * FROM tblTABLE_INFO" Set moRSInvINFO = New Recordset moRSInvINFO.Open strSQLINFO, goConn, adOpenDynamic, adLockPessimistic moRSInvINFO!ARINVOICE_TRANS_ID = mlngINVID moRSInvINFO.Update End With gstrMODULE = "Before Update mlngINVID second time" If Field2Integer(moRSProj!retention) > 0 Then dblRETENTION = Format(((dblINVTOTAL * Field2Integer(moRSProj!retention)) / 100), "##.00") Else dblRETENTION = 0 End If If moRSProj!cocode = 0 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICE where inv_type = 'PE' and Lot_id = " & gintLOTID ElseIf moRSProj!cocode = 1 Then strSQL = "SELECT trans_id, lot_id, inv_type, non_tax_amt, Retention_Amt FROM tblARINVOICEM where inv_type = 'PE' and Lot_id = " & gintLOTID End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockPessimistic Do Until oRS.EOF oRS!non_tax_amt = dblINVTOTAL oRS!retention_amt = dblRETENTION oRS.Update oRS.MoveNext Loop If moRSProj!cocode = 0 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & " AND {tblARInvoice.Inv_Type} = 'PE'" ' strSELECT = "{tblARInvoice.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoice.rpt" ElseIf moRSProj!cocode = 1 Then strSELECT = "{tblARInvoice.Lot_ID} = " & gintLOTID & "AND {tblARInvoice.Inv_Type} = 'PE'" ' strSELECT = "{tblARInvoiceM.po_num} = '" & gstrPONUM & "'" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crOrder.ReportFileName = App.Path & "\invoiceM.rpt" End If crOrder.ReplaceSelectionFormula (strSELECT) crOrder.CopiesToPrinter = gintCOPY ' crOrder.Destination = crptToWindow crOrder.Destination = crptToPrinter crOrder.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form LotInfo - Module PrintPaintExteriorInv" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub