⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmhwpdrc.frm

📁 企业的进销存源码
💻 FRM
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "Vsflex7.ocx"
Begin VB.Form frmHwPdRc 
   Caption         =   "货物盘点差异原因"
   ClientHeight    =   5070
   ClientLeft      =   2130
   ClientTop       =   2400
   ClientWidth     =   8415
   LinkTopic       =   "Form1"
   ScaleHeight     =   5070
   ScaleWidth      =   8415
   Begin VB.Frame Frame 
      Height          =   2205
      Left            =   3000
      TabIndex        =   0
      Top             =   30
      Width           =   5355
      Begin VB.CommandButton Command 
         Caption         =   "保存(&S)"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   3
         Left            =   2790
         TabIndex        =   7
         Top             =   1650
         Width           =   1125
      End
      Begin VB.CommandButton Command 
         Caption         =   "新增(&A)"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   150
         TabIndex        =   6
         Top             =   1650
         Width           =   1125
      End
      Begin VB.CommandButton Command 
         Caption         =   "删除(&D)"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   2
         Left            =   1470
         TabIndex        =   5
         Top             =   1650
         Width           =   1125
      End
      Begin VB.CheckBox Check 
         Caption         =   "停用"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   0
         Left            =   1890
         TabIndex        =   2
         Top             =   810
         Width           =   1965
      End
      Begin VB.TextBox Text 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Index           =   1
         Left            =   1890
         TabIndex        =   1
         Top             =   255
         Width           =   3255
      End
      Begin VB.Label Label 
         Caption         =   "盘点差异原因名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Index           =   1
         Left            =   180
         TabIndex        =   3
         Top             =   315
         Width           =   1575
      End
   End
   Begin VSFlex7Ctl.VSFlexGrid Flex 
      Height          =   4935
      Index           =   0
      Left            =   30
      TabIndex        =   4
      Top             =   60
      Width           =   2805
      _cx             =   4948
      _cy             =   8705
      _ConvInfo       =   1
      Appearance      =   1
      BorderStyle     =   1
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      MousePointer    =   0
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      BackColorFixed  =   -2147483633
      ForeColorFixed  =   -2147483630
      BackColorSel    =   -2147483635
      ForeColorSel    =   -2147483634
      BackColorBkg    =   -2147483636
      BackColorAlternate=   -2147483643
      GridColor       =   -2147483633
      GridColorFixed  =   -2147483632
      TreeColor       =   -2147483632
      FloodColor      =   192
      SheetBorder     =   -2147483642
      FocusRect       =   1
      HighLight       =   1
      AllowSelection  =   -1  'True
      AllowBigSelection=   -1  'True
      AllowUserResizing=   1
      SelectionMode   =   1
      GridLines       =   1
      GridLinesFixed  =   2
      GridLineWidth   =   1
      Rows            =   2
      Cols            =   2
      FixedRows       =   1
      FixedCols       =   1
      RowHeightMin    =   0
      RowHeightMax    =   0
      ColWidthMin     =   0
      ColWidthMax     =   0
      ExtendLastCol   =   0   'False
      FormatString    =   "|<盘点差异原因"
      ScrollTrack     =   0   'False
      ScrollBars      =   3
      ScrollTips      =   0   'False
      MergeCells      =   0
      MergeCompare    =   0
      AutoResize      =   -1  'True
      AutoSizeMode    =   0
      AutoSearch      =   0
      AutoSearchDelay =   2
      MultiTotals     =   -1  'True
      SubtotalPosition=   1
      OutlineBar      =   0
      OutlineCol      =   0
      Ellipsis        =   0
      ExplorerBar     =   0
      PicturesOver    =   0   'False
      FillStyle       =   0
      RightToLeft     =   0   'False
      PictureType     =   0
      TabBehavior     =   0
      OwnerDraw       =   0
      Editable        =   0
      ShowComboButton =   -1  'True
      WordWrap        =   0   'False
      TextStyle       =   0
      TextStyleFixed  =   0
      OleDragMode     =   0
      OleDropMode     =   0
      DataMode        =   0
      VirtualData     =   -1  'True
      DataMember      =   ""
      ComboSearch     =   3
      AutoSizeMouse   =   -1  'True
      FrozenRows      =   0
      FrozenCols      =   0
      AllowUserFreezing=   0
      BackColorFrozen =   0
      ForeColorFrozen =   0
      WallPaperAlignment=   9
   End
End
Attribute VB_Name = "frmHwPdRc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'QQ:75347626
'MSN:whailin2000@hotmail.com
Option Explicit

Const FlexHwPdRc = 0
Const TxtHwPdRcMc = 1
Const ChkHwPdRcIsStop = 0

Const CmdAdd = 0
Const CmdDel = 2
Const CmdSave = 3

Dim OHwPdRc As HwPdRc
Dim OHwPdRcs As HwPdRcs

Private Sub Command_Click(Index As Integer)
On Error GoTo Errorhandle

   Select Case Index
   Case CmdAdd
         AddRecord
   Case CmdDel
         Delrecord
   Case CmdSave
         SaveRecord
   End Select

Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub Form_Load()
On Error GoTo Errorhandle

   LoadDataIntoGrid
   
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub LoadDataIntoGrid()
   Dim ItemStr As String
   Dim mHwPdRc As HwPdRc
On Error GoTo Errorhandle

   Flex(FlexHwPdRc).Rows = 1
   
   Set OHwPdRcs = New HwPdRcs
   OHwPdRcs.Fillbydb
      
   For Each mHwPdRc In OHwPdRcs
      ItemStr = vbTab & mHwPdRc.HwPdRcMc
      Flex(FlexHwPdRc).AddItem ItemStr
      Flex(FlexHwPdRc).RowData(Flex(FlexHwPdRc).Rows - 1) = mHwPdRc.HwPdRcKey
   Next
   If Flex(FlexHwPdRc).Rows > 1 Then
      Flex(FlexHwPdRc).Row = 1
      Set OHwPdRc = OHwPdRcs(CStr(Flex(FlexHwPdRc).RowData(1)))
      SetValueToControl
   Else
      Set OHwPdRc = Nothing
      Clearcontrol
   End If

Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub AddRecord()
On Error GoTo Errorhandle

   Set OHwPdRc = New HwPdRc
   Clearcontrol
   Text(TxtHwPdRcMc).SetFocus
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Clearcontrol()
On Error GoTo Errorhandle

   Text(TxtHwPdRcMc).Text = ""
   Check(ChkHwPdRcIsStop).Value = vbUnchecked
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub SaveRecord()
On Error GoTo Errorhandle
    
   SetValueToObject

   If OHwPdRc.HwPdRcId = -1 Then
      OHwPdRcs.Add OHwPdRc
      ChgGrid "ADD"
   Else
      OHwPdRc.Save
      ChgGrid "CHG"
   End If
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub SetValueToObject()
On Error GoTo Errorhandle

   OHwPdRc.HwPdRcMc = Trim(Text(TxtHwPdRcMc).Text)
   OHwPdRc.HwPdRcIsStop = Check(ChkHwPdRcIsStop)
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub ChgGrid(RecordName As String)
   Dim ItemStr As String
On Error GoTo Errorhandle

   If RecordName = "ADD" Then
      ItemStr = vbTab & OHwPdRc.HwPdRcMc
      Flex(FlexHwPdRc).AddItem ItemStr
      Flex(FlexHwPdRc).RowData(Flex(FlexHwPdRc).Rows - 1) = OHwPdRc.HwPdRcKey
      Flex(FlexHwPdRc).Row = Flex(FlexHwPdRc).Rows - 1
   Else
      Flex(FlexHwPdRc).TextMatrix(Flex(FlexHwPdRc).Row, 1) = Text(TxtHwPdRcMc).Text
   End If

Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Delrecord()
On Error GoTo Errorhandle

   If Flex(FlexHwPdRc).Rows = 1 Then
      Exit Sub
   End If

   If MsgBox("您真的要删除吗?", vbYesNo) = vbYes Then
      OHwPdRcs.Remove CStr(OHwPdRc.HwPdRcKey)
      Flex(FlexHwPdRc).RemoveItem Flex(FlexHwPdRc).Row
      If Flex(FlexHwPdRc).Rows = 1 Then
         Set OHwPdRc = Nothing
         Clearcontrol
      Else
         Set OHwPdRc = OHwPdRcs(CStr(Flex(FlexHwPdRc).RowData(Flex(FlexHwPdRc).Row)))
         SetValueToControl
      End If
   End If
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Flex_RowColChange(Index As Integer)
On Error GoTo Errorhandle

   If Flex(FlexHwPdRc).Rows >= 1 Then
      Set OHwPdRc = OHwPdRcs(CStr(Flex(FlexHwPdRc).RowData(Flex(FlexHwPdRc).Row)))
      SetValueToControl
   Else
      Set OHwPdRc = Nothing
      Clearcontrol
   End If
   
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub SetValueToControl()
On Error GoTo Errorhandle

   Text(TxtHwPdRcMc).Text = OHwPdRc.HwPdRcMc
   Check(ChkHwPdRcIsStop).Value = OHwPdRc.HwPdRcIsStop
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Errorhandle

   Set OHwPdRc = Nothing
   Set OHwPdRcs = Nothing
   
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub Form_Resize()
On Error GoTo Errorhandle
   Resize_ALL Me
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -