VERSION 5.00 Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" Begin VB.Form frmYardOrder Caption = "Yard Order Information" ClientHeight = 6225 ClientLeft = 60 ClientTop = 345 ClientWidth = 10470 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty KeyPreview = -1 'True LinkTopic = "Form1" ScaleHeight = 6225 ScaleWidth = 10470 StartUpPosition = 3 'Windows Default Begin LpLib.fpList lstInventory Height = 2805 Left = 60 TabIndex = 29 Top = 660 Width = 5310 _Version = 196608 _ExtentX = 9366 _ExtentY = 4948 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Enabled = -1 'True MousePointer = 0 Object.TabStop = 0 'False BackColor = -2147483643 ForeColor = -2147483640 Columns = 13 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= -1 'True ColumnHeaderHeight= -1 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmYardOrder.frx":0000 End Begin LpLib.fpList lstInv Height = 2025 Left = 5400 TabIndex = 28 Top = 4140 Width = 3915 _Version = 196608 _ExtentX = 6906 _ExtentY = 3572 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 = 2 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= -1 'True ColumnHeaderHeight= -1 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmYardOrder.frx":0613 End Begin VB.CommandButton cmdPopulate Caption = "Retrieve Yard Order" Height = 555 Left = 8040 TabIndex = 25 Top = 900 Visible = 0 'False Width = 1155 End Begin VB.CommandButton cmdUpdateIssue Caption = "Update Issue Date" Height = 555 Left = 9240 TabIndex = 24 Top = 900 Visible = 0 'False Width = 1155 End Begin VB.TextBox txtMemo Height = 1995 Left = 60 MultiLine = -1 'True TabIndex = 9 Top = 4140 Width = 5235 End Begin VB.TextBox txtQIssue Alignment = 1 'Right Justify BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 6840 MaxLength = 6 TabIndex = 7 Top = 1380 Width = 855 End Begin VB.CommandButton cmdExit Caption = "&Exit" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 555 Left = 9240 TabIndex = 13 Top = 1500 Width = 1155 End Begin VB.CommandButton cmdDeleteInv Caption = "&Delete Inventory" 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 = 555 Left = 9240 TabIndex = 12 Top = 3300 Visible = 0 'False Width = 1155 End Begin VB.CommandButton cmdSaveInv Caption = "&Save Inventory" 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 = 555 Left = 9240 TabIndex = 10 Top = 2100 Width = 1155 End Begin VB.CommandButton cmdAddInv Caption = "&Add Inventory" 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 = 555 Left = 9240 TabIndex = 11 Top = 2700 Width = 1155 End Begin VB.CommandButton cmdFindInv Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 435 Left = 9525 Picture = "frmYardOrder.frx":09AC Style = 1 'Graphical TabIndex = 5 Top = 60 Visible = 0 'False Width = 435 End Begin VB.TextBox txtPrice Alignment = 1 'Right Justify BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 6840 MaxLength = 8 TabIndex = 8 Top = 1800 Width = 855 End Begin VB.TextBox txtDesc BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 6840 MaxLength = 30 TabIndex = 6 Top = 540 Width = 3555 End Begin VB.TextBox txtInvNo BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 6840 MaxLength = 18 TabIndex = 4 Top = 135 Width = 2625 End Begin VB.Label lblPO_NUM BorderStyle = 1 'Fixed Single BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 435 Left = 5820 TabIndex = 27 Top = 3480 Width = 3255 End Begin VB.Label lblPO Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "PO:" Height = 195 Left = 5400 TabIndex = 26 Top = 3600 Width = 330 End Begin VB.Label Label1 Caption = "Yard Order Notes:" Height = 255 Left = 120 TabIndex = 23 Top = 3900 Width = 1575 End Begin VB.Label txtQty Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 315 Left = 6840 TabIndex = 22 Top = 960 Width = 855 End Begin VB.Label lblQIssue Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Qty Issued:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 6000 TabIndex = 21 Top = 1440 Width = 795 End Begin VB.Label txtIssue Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 315 Left = 6840 TabIndex = 20 Top = 3060 Width = 1275 End Begin VB.Label txtChange Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 315 Left = 6840 TabIndex = 19 Top = 2640 Width = 1275 End Begin VB.Label txtCreate Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single BeginProperty DataFormat Type = 1 Format = "MM/dd/yyyy" HaveTrueFalseNull= 0 FirstDayOfWeek = 0 FirstWeekOfYear = 0 LCID = 1033 SubFormatType = 3 EndProperty Height = 315 Left = 6840 TabIndex = 18 Top = 2220 Width = 1275 End Begin VB.Label lblIssued Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Date Issued:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 5895 TabIndex = 17 Top = 3060 Width = 900 End Begin VB.Label lblChange Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Date Qty Change:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 5520 TabIndex = 16 Top = 2640 Width = 1275 End Begin VB.Label lblCreate Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Date Order Printed:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 5430 TabIndex = 15 Top = 2220 Width = 1365 End Begin VB.Label lblQty Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Original Qty:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 5940 TabIndex = 14 Top = 1020 Width = 855 End Begin VB.Label lblPrice Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Cost:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 6435 TabIndex = 3 Top = 1860 Width = 360 End Begin VB.Label lblDesc Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Description:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 5895 TabIndex = 2 Top = 600 Width = 840 End Begin VB.Label lblInvNo Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Inventory #:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 5880 TabIndex = 1 Top = 180 Width = 855 End Begin VB.Label lblInventory AutoSize = -1 'True Caption = "Yard Order Inventory Items:" 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 = 120 TabIndex = 0 Top = 180 Width = 2835 End End Attribute VB_Name = "frmYardOrder" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim moRSMat As Recordset Dim moRSMemo As Recordset Dim moRS As Recordset Dim mboolSHOW As Boolean Dim mboolAdding As Boolean Private Sub LoadInventory() Dim oRS As Recordset, oRSS As Recordset Dim strSQL As String, strSQLL As String, lngORDERID As Long Dim strLine As String, strORDERNUM As String On Error GoTo Error_EH strORDERNUM = "" ' strSQL = "SELECT Yard_id, Inv_no, Desc, qty, qtyissue, Price from tblYardOrder WHERE lot_id = " & gintLOTID strSQL = "SELECT * from tblYardOrder WHERE lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic lstInventory.Clear Do Until oRS.EOF With lstInventory strORDERNUM = Field2Str(oRS!po_num) ' If strORDERNUM = "ORIGINAL ORDER" Or strORDERNUM = "HANDWRITTEN PO" Or strORDERNUM = "PARTIAL ORDER" Then If strORDERNUM <> "ORIGINAL ORDER" And strORDERNUM <> "HANDWRITTEN PO" And strORDERNUM <> "PARTIAL ORDER" And strORDERNUM <> "" Then strSQLL = "SELECT Order_ID, PO_NUM from tblORDERS WHERE PO_NUM = '" & strORDERNUM & "'" Set oRSS = New Recordset oRSS.Open strSQLL, goConn, adOpenForwardOnly, adLockReadOnly If Not oRSS.EOF Then lngORDERID = oRSS!order_id End If End If If Field2Str(oRS!d_flag) = "" Then oRS!d_flag = "Y" oRS.Update End If ' strLine = oRS!inv_no & " " & oRS!qty & vbTab & oRS!qtyissue & vbTab & oRS!Desc strLine = Field2Str(oRS!Yard_id) & vbTab & Field2Str(oRS!inv_no) & vbTab & Field2Str(oRS!qty) & vbTab strLine = strLine & Field2Str2(oRS!qtyIssue) & vbTab & Field2Str(oRS!Desc) & vbTab & Field2Str2(oRS!Lot_ID) & vbTab strLine = strLine & Field2Str(oRS!po_num) & vbTab & Field2Str(oRS!d_flag) & vbTab & Field2Str(oRS!m_type) strLine = strLine & vbTab & Field2Str(oRS!price) & vbTab & Field2Str(oRS!createuser) & vbTab & oRS!moved & vbTab & lngORDERID .AddItem strLine .ItemData(.NewIndex) = oRS!Yard_id ' & oRS!qty End With oRS.MoveNext Loop oRS.Close If lstInventory.ListCount Then lstInventory.ListIndex = 0 cmdPopulate.Visible = False Else If gbytSECURITY = 1 Or gbytSECURITY = 9 Or gbytSECURITY = 8 Then cmdPopulate.Visible = True End If End If Exit Sub Error_EH: Call ErrorHandler2 Exit Sub End Sub Private Sub cmdFindInv_Click() Dim oRS As Recordset Dim strSQL As String, lngFind As Long On Error GoTo Error_EH If txtInvNo = "" Then txtInvNo = 1 End If strSQL = "SELECT * from tblInvtry WHERE Inv_no = '" & txtInvNo.Text & "' and Inv_Type = " & gbytINV_TYPE Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly If oRS.RecordCount > 0 Then With oRS txtInvNo = Field2Str(!inv_no) txtDesc = Field2Str(!Desc) txtPrice = Field2Str(!price) End With Else lstInv.Visible = True Call LoadMInventory lngFind = Field2Long(txtInvNo) Call ListFindItem2(lstInv, lngFind) End If txtQIssue.SetFocus oRS.Close Exit Sub Error_EH: Call ErrorHandler2 Exit Sub End Sub Private Sub LoadMInventory() 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 lstInv.Clear Do Until oRS.EOF With lstInv strLine = oRS!inv_no & vbTab & oRS!Desc .AddItem strLine .ItemData(.NewIndex) = oRS!inv_no End With oRS.MoveNext Loop oRS.Close If lstInv.ListCount Then lstInv.ListIndex = -1 End If Exit Sub Error_EH: Call ErrorHandler2 Exit Sub End Sub Private Sub FormClear() txtInvNo = "" txtDesc = "" txtPrice = 0 txtQIssue = 0 txtQty.Caption = 0 txtCreate = "" txtChange = "" txtIssue = "" End Sub Private Function FormFind() As Boolean Dim strSQL As String, strMEMO As String On Error GoTo Error_EH strSQL = "SELECT * " strSQL = strSQL & "FROM tblYardOrder " strSQL = strSQL & "WHERE Yard_id = " & lstInventory.ItemData(lstInventory.ListIndex) If moRSMat.State = adStateOpen Then moRSMat.Close End If moRSMat.Open strSQL, goConn, _ adOpenKeyset, adLockOptimistic strMEMO = "SELECT * FROM tblYardMemo where lot_id = " & gintLOTID Set moRSMemo = New Recordset moRSMemo.Open strMEMO, goConn, adOpenForwardOnly, adLockOptimistic If moRSMemo.RecordCount = 0 Then moRSMemo.AddNew moRSMemo!Lot_ID = gintLOTID End If If moRSMat.EOF Then FormFind = False Else FormFind = True End If Exit Function Error_EH: moRSMat.Update Resume Next End Function Private Sub FindLot() Dim strSQL As String, strPlan As String, strMEMO As String On Error GoTo Error_EH strSQL = "SELECT * " strSQL = strSQL & "FROM tblLotInfo " strSQL = strSQL & "WHERE Lot_ID = " & gintLOTID If moRS.State = adStateOpen Then moRS.Close End If moRS.Open strSQL, goConn, _ adOpenKeyset, adLockPessimistic Exit Sub Error_EH: gstrMODULE = "Form YardOrder - Module FindLot" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormSave() Dim strName As String, strISSUE As String, strSQL As String Dim lngPOS As Long Dim strMEMO As String On Error GoTo Error_EH If mboolAdding Then ' strSQL = "SELECT * " ' strSQL = strSQL & "FROM tblYardOrder " ' strSQL = strSQL & "WHERE Yard_id = " & lstInventory.ItemData(lstInventory.ListIndex) If moRSMat.State = adStateClosed Then strSQL = "SELECT * " strSQL = strSQL & "FROM tblYardOrder " strSQL = strSQL & "WHERE Yard_id = 1" moRSMat.Open strSQL, goConn, _ adOpenKeyset, adLockOptimistic strMEMO = "SELECT * FROM tblYardMemo where lot_id = " & gintLOTID Set moRSMemo = New Recordset moRSMemo.Open strMEMO, goConn, adOpenForwardOnly, adLockOptimistic If moRSMemo.RecordCount = 0 Then moRSMemo.AddNew moRSMemo!Lot_ID = gintLOTID End If End If 'if morsmat moRSMat.AddNew moRSMat!po_num = "HANDWRITTEN PO" moRSMat!Lot_ID = gintLOTID strISSUE = InputBox("Enter the Issue Date for This Item", "Issue Date") lngPOS = InStr(1, strISSUE, "/", 1) If lngPOS = 0 Then If Len(strISSUE) > 0 Then strISSUE = Format(strISSUE, "00/00/####") If Not IsDate(strISSUE) Then MsgBox "The Date You Entered is not Valid - The Issue Date as not updated" Exit Sub End If Else Exit Sub End If Else MsgBox "Invalid Date Format, The Issue Date as not Updated", , "Invalid Date - ReEnter" Exit Sub End If moRSMat!issued = Str2Field(strISSUE) End If ' Store the controls to the recordset Call FieldsSave moRSMat.Update If mboolAdding Then mboolAdding = False End If Exit Sub Error_EH: Call ErrorHandler(moRSMat.ActiveConnection) Exit Sub End Sub Private Sub FormShow() On Error GoTo Error_EH mboolSHOW = True With moRSMat txtInvNo = Field2Str(!inv_no) txtDesc = Field2Str(!Desc) txtPrice = Format$(Field2Str(!price), "##,###.00") txtQty = Field2Str(!qty) txtQIssue = Field2Str(!qtyIssue) txtCreate = Format$(Field2Str(!created), "short date") txtChange = Format$(Field2Str(!Updated), "short date") txtIssue = Format$(Field2Str(!issued), "short date") lblPO_NUM = Field2Str(!po_num) End With txtMemo = Field2Str(moRSMemo!notes) mboolSHOW = False Exit Sub Error_EH: Call ErrorHandler2 Exit Sub End Sub Private Sub FieldsSave() On Error GoTo Error_EH With moRSMat !inv_no = Str2Field(txtInvNo) !Desc = Str2Field(txtDesc) !qtyIssue = Str2Field(txtQIssue) !price = Str2Field(txtPrice) !Updated = Now() !UpdateUser = gstrLOGIN End With moRSMemo!notes = Field2Str(txtMemo) moRSMemo.Update Exit Sub Error_EH: If Err = -2147467259 Then Resume Next ' Exit Sub End If Call ErrorHandler2 Exit Sub End Sub Private Sub cmdAddInv_Click() cmdAddInv.Enabled = False cmdSaveInv.Enabled = True cmdDeleteInv.Enabled = False lstInventory.Enabled = False mboolAdding = True Call FormClear txtInvNo.SetFocus cmdFindInv.Visible = True End Sub Private Sub cmdDeleteInv_Click() cmdDeleteInv.Enabled = False cmdSaveInv.Enabled = False cmdAddInv.Enabled = True moRSMat.Delete Call LoadInventory End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub MovePZ() Dim oRS As Recordset, strSQL As String, boolMOVE As Boolean, strMSG As String Dim oRSS As Recordset, strSQLL As String, strPONUM As String strSQL = "SELECT * FROM tblORDMatrl WHERE ITEM_ID = 1" Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenDynamic, adLockOptimistic If Not oRS.EOF Then lstInventory.col = 6 strPONUM = lstInventory.ColText lstInventory.col = 11 boolMOVE = lstInventory.ColText If strPONUM = "ORIGINAL ORDER" Or strPONUM = "HANDWRITTEN PO" Or strPONUM = "PARTIAL ORDER" Or strPONUM = "" Or boolMOVE Then strMSG = "The Hi-Lited Item Cannot Be Moved To tblORDMatrl " & vbCrLf & vbCrLf strMSG = strMSG & "Or Has Already Been Moved - Exiting" MsgBox strMSG, vbOKOnly, "Invalid Record" Exit Sub End If oRS.AddNew lstInventory.col = 1 oRS!inv_no = lstInventory.ColText lstInventory.col = 2 oRS!o_qty = lstInventory.ColText lstInventory.col = 3 oRS!a_qty = lstInventory.ColText lstInventory.col = 4 oRS!Desc = lstInventory.ColText lstInventory.col = 5 oRS!Lot_ID = lstInventory.ColText lstInventory.col = 6 oRS!po_num = lstInventory.ColText lstInventory.col = 7 oRS!d_flag = lstInventory.ColText lstInventory.col = 8 oRS!m_type = lstInventory.ColText lstInventory.col = 9 oRS!price = lstInventory.ColText lstInventory.col = 10 oRS!C_USER = lstInventory.ColText lstInventory.col = 12 oRS!order_id = lstInventory.ColText oRS!moved = True oRS.Update lstInventory.col = 0 strSQLL = "SELECT YARD_ID, MOVED FROM tblYardOrder WHERE Yard_ID = " & CLng(lstInventory.ColText) Set oRSS = New Recordset oRSS.Open strSQLL, goConn, adOpenDynamic, adLockOptimistic If Not oRSS.EOF Then oRSS!moved = True oRSS.Update End If MsgBox "Hi-lited Item Has Been Moved To Order Material", vbOKOnly, "Item Moved" End If End Sub Private Sub cmdPopulate_Click() Dim strSQL As String, strSELECT As String, strYARD As String, strPRICE As String Dim oRS As Recordset, oRSS As Recordset Dim strMSG As String, strMEMO As String On Error GoTo Error_EH If Date2Field(moRS!lorder) > Now() Then strMSG = "This Lot Has Not Been Printed Yet," & vbCrLf strMSG = strMSG & "The Yard Order Will be Populated" & vbCrLf strMSG = strMSG & "Automatically When Printed - Call Darv" MsgBox strMSG, vbCritical + vbOKOnly, "Call Darv" Exit Sub End If 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 = " & Field2Integer(oRSS!inv_no) oRS.MoveFirst oRS.Find strSELECT If Not oRS.EOF Then 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 strYARD = "SELECT * FROM tblLotMatrl WHERE lot_id = " & gintLOTID & " and D_Flag = 'Y' and (M_Type = 'L' or M_Type = 'P' or M_Type = 'Z')" 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!createuser = gstrLOGIN oRS!UpdateUser = gstrLOGIN oRS.Update oRSS.MoveNext Loop txtMemo = Field2Str(txtMemo) & " YARD ORDER RETRIEVED - " & Now() & " BY " & gstrLOGIN If moRSMemo.State = adStateClosed Then strMEMO = "SELECT * FROM tblYardMemo WHERE lot_id = " & gintLOTID Set moRSMemo = New Recordset moRSMemo.Open strMEMO, goConn, adOpenKeyset, adLockOptimistic If moRSMemo.RecordCount Then moRSMemo!notes = UCase(Field2Str(txtMemo)) moRSMemo.Update Else moRSMemo.AddNew moRSMemo!Lot_ID = gintLOTID moRSMemo!notes = UCase(Field2Str(txtMemo)) moRSMemo.Update End If End If Call LoadInventory Exit Sub Error_EH: gstrMODULE = "Form YardORder - Module cmdPopulate_Click" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdSaveInv_Click() cmdSaveInv.Enabled = False cmdDeleteInv.Enabled = False cmdAddInv.Enabled = True cmdFindInv.Visible = False lstInventory.Enabled = True Call FormSave Call LoadInventory End Sub Private Sub cmdUpdateIssue_Click() Dim oRS As Recordset Dim strSQL As String, strISSUE As String Dim lngPOS As Long strISSUE = InputBox("Enter the Issue Date for this Yard Order (mmddyyyy)", "Issue Date") lngPOS = InStr(1, strISSUE, "/", 1) If lngPOS = 0 Then If Len(strISSUE) > 0 Then strISSUE = Format(strISSUE, "00/00/####") If Not IsDate(strISSUE) Then MsgBox "The Date You Entered is not Valid - The Issue Date as not updated" Exit Sub End If Else Exit Sub End If Else MsgBox "Invalid Date Format, The Issue Date as not Updated", , "Invalid Date - ReEnter" Exit Sub End If strSQL = "SELECT * FROM tblYardOrder WHERE not locked and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRS!issued = strISSUE oRS!Locked = vbChecked oRS.Update oRS.MoveNext Loop Call LoadInventory End Sub Private Sub OneIssue() Dim oRS As Recordset, lngYARDID As Long Dim strSQL As String, strISSUE As String Dim lngPOS As Long strISSUE = InputBox("Enter The Issue Date For The HiLited Item (mmddyyyy)", "One Issue Date") lngPOS = InStr(1, strISSUE, "/", 1) If lngPOS = 0 Then If Len(strISSUE) > 0 Then strISSUE = Format(strISSUE, "00/00/####") If Not IsDate(strISSUE) Then MsgBox "The Date You Entered is not Valid - The Issue Date as not updated" Exit Sub End If Else Exit Sub End If Else MsgBox "Invalid Date Format, The Issue Date as not Updated", , "Invalid Date - ReEnter" Exit Sub End If lstInventory.col = 0 lngYARDID = CLng(lstInventory.ColText) 'FIX THIS FOR ONE ITEM strSQL = "SELECT * FROM tblYardOrder WHERE not locked and lot_id = " & gintLOTID Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenKeyset, adLockOptimistic Do Until oRS.EOF oRS!issued = strISSUE oRS!Locked = vbChecked oRS.Update oRS.MoveNext Loop Call LoadInventory End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim ShiftDown, AltDown, CtrlDown If Shift = 4 Then Exit Sub End If ShiftDown = (Shift And vbShiftMask) > 0 AltDown = (Shift And vbAltMask) > 0 CtrlDown = (Shift And vbCtrlMask) > 0 If Not cmdSaveInv.Enabled Then cmdSaveInv.Enabled = True cmdAddInv.Enabled = False End If If KeyCode = vbKeyQ And gbytSECURITY = 1 Then If CtrlDown Then Call MovePZ ' MsgBox "Hi-lited Item Has Been Moved To Order Material", vbOKOnly, "Item Moved" End If Exit Sub End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{TAB}" KeyAscii = 0 End If End Sub Private Sub Form_Load() Set moRSMat = New Recordset Set moRSMemo = New Recordset Set moRS = New Recordset Call FindLot Call LoadInventory If gbytSECURITY = 1 Or gbytSECURITY = 9 Or gbytSECURITY = 8 Then cmdUpdateIssue.Visible = True cmdAddInv.Enabled = True ' cmdSaveInv.Enabled = True cmdFindInv.Enabled = True End If If gbytSECURITY = 1 Then cmdDeleteInv.Visible = True End If 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 cmdSaveInv.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 End Select End If If moRSMat.State = adStateOpen Then moRSMat.Close End If Exit Sub Error_EH: If Err = 3219 Then Resume Next Else End If End Sub Private Sub lstInv_DblClick() Dim oRS As Recordset Dim strSQL As String On Error GoTo Error_EH strSQL = "SELECT Inv_no, Desc, price FROM tblInvtry where Inv_no = " & lstInv.ItemData(lstInv.ListIndex) Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly With oRS txtInvNo = Field2Str(!inv_no) txtDesc = Field2Str(!Desc) txtPrice = Field2Str(!price) End With oRS.Close txtQIssue.SetFocus lstInv.Visible = False If gbytSECURITY = 1 Then cmdDeleteInv.Visible = True End If Exit Sub Error_EH: Call ErrorHandler2 Exit Sub End Sub Private Sub lstInventory_Click() On Error GoTo Error_EH If lstInventory.ListIndex <> -1 Then If FormFind() Then Call FormShow End If End If Exit Sub Error_EH: Call ErrorHandler2 Exit Sub End Sub Private Sub lstInventory_DblClick() If gbytSECURITY = 1 Then ' If gbytSECURITY = 1 Or gbytSECURITY = 9 Or gbytSECURITY = 8 Then cmdPopulate.Visible = True cmdSaveInv.Enabled = True cmdDeleteInv.Enabled = True cmdAddInv.Enabled = False End If End Sub Private Sub txtDesc_GotFocus() Call FieldSelect(txtDesc) End Sub Private Sub txtDesc_LostFocus() txtDesc = UCase(txtDesc) End Sub Private Sub txtInvNo_GotFocus() Call FieldSelect(txtInvNo) End Sub Private Sub txtMemo_LostFocus() txtMemo = UCase(txtMemo) End Sub Private Sub txtQIssue_GotFocus() Call FieldSelect(txtQIssue) End Sub Private Sub txtPrice_GotFocus() Call FieldSelect(txtPrice) End Sub Private Sub txtQIssue_LostFocus() Call FieldSelect(txtQIssue) End Sub