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

📄 frmlistedit.frm

📁 办公用品管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmListEdit 
   Caption         =   "编辑办公用品领用信息"
   ClientHeight    =   3435
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3675
   LinkTopic       =   "Form1"
   ScaleHeight     =   3435
   ScaleWidth      =   3675
   StartUpPosition =   2  '屏幕中心
   Begin MSDataListLib.DataCombo dco_Store 
      Height          =   330
      Left            =   1560
      TabIndex        =   7
      Top             =   1385
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   582
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取 消"
      Height          =   495
      Left            =   2040
      TabIndex        =   4
      Top             =   2640
      Width           =   1215
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Height          =   495
      Left            =   360
      TabIndex        =   3
      Top             =   2640
      Width           =   1215
   End
   Begin VB.TextBox txtAmount 
      Height          =   315
      Left            =   1560
      TabIndex        =   1
      Text            =   "0"
      Top             =   1950
      Width           =   1455
   End
   Begin MSDataListLib.DataCombo dco_Type 
      Height          =   330
      Left            =   1560
      TabIndex        =   5
      Top             =   810
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   582
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin MSAdodcLib.Adodc Ado_Type 
      Height          =   330
      Left            =   -120
      Top             =   2520
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Ado_Type"
      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
      _Version        =   393216
   End
   Begin MSDataListLib.DataCombo dco_UType 
      Height          =   330
      Left            =   1560
      TabIndex        =   6
      Top             =   240
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   582
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin MSAdodcLib.Adodc Ado_UType 
      Height          =   330
      Left            =   -120
      Top             =   2760
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Ado_UType"
      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
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Ado_Store 
      Height          =   330
      Left            =   -120
      Top             =   2280
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Ado_Store"
      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
      _Version        =   393216
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "办公用品名称"
      Height          =   195
      Left            =   240
      TabIndex        =   9
      Top             =   1435
      Width           =   1080
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "二级分类名称"
      Height          =   180
      Left            =   240
      TabIndex        =   8
      Top             =   875
      Width           =   1080
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "领用数量"
      Height          =   180
      Left            =   600
      TabIndex        =   2
      Top             =   2010
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "一级分类名称"
      Height          =   180
      Left            =   240
      TabIndex        =   0
      Top             =   315
      Width           =   1080
   End
End
Attribute VB_Name = "FrmListEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriListId As Long
Public OriId As Long
Public Modify As Boolean

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub Cmd_OK_Click()
  If Len(Trim(dco_UType.Text)) = 0 Then
    MsgBox "请选择一级分类名称"
    dco_UType.SetFocus
    Exit Sub
  End If
  If Len(Trim(dco_Type.Text)) = 0 Then
    MsgBox "请选择二级分类名称"
    dco_Type.SetFocus
    Exit Sub
  End If
  If Len(Trim(dco_Store.Text)) = 0 Then
    MsgBox "请选择办公用品名称"
    dco_Store.SetFocus
    Exit Sub
  End If
  If Len(Trim(txtAmount)) = 0 Or Val(txtAmount) = 0 Then
    MsgBox "请输入领用数量"
    txtAmount.SetFocus
    Exit Sub
  End If
  With MyList
    .DId = OriId
    .OId = dco_Store.BoundText()
    .OAmount = Val(txtAmount)
    If Modify = False Then
      .Insert
      MsgBox "添加成功"
    Else
      .Update (OriListId)
      MsgBox "保存成功"
    End If
  End With
  Unload Me
End Sub

Private Sub dco_Type_Click(Area As Integer)
  If Len(Trim(dco_Type.Text)) > 0 Then
    Ado_Store.ConnectionString = Conn
    Ado_Store.RecordSource = "Select * From Store Where TypeId=" + Trim(dco_Type.BoundText()) + " Order By OId"
    Ado_Store.Refresh
    Set dco_Store.RowSource = Ado_Store
    dco_Store.ListField = "OName"
    dco_Store.BoundColumn = "OId"
    dco_Store.Text = ""
  End If
End Sub

Private Sub dco_UType_Click(Area As Integer)
  Refresh_Type
End Sub

Private Sub Form_Load()
  '装入分类信息
  Ado_UType.ConnectionString = Conn
  Ado_UType.RecordSource = "Select * From Types Where UpperId=0 Order By TypeId"
  Ado_UType.Refresh
  Set dco_UType.RowSource = Ado_UType
  dco_UType.ListField = "TypeName"
  dco_UType.BoundColumn = "TypeId"
  '装入二级分类信息
  Ado_Type.ConnectionString = Conn
  Ado_Type.RecordSource = "Select * From Types Where UpperId>0 Order By TypeId"
  Ado_Type.Refresh
  Set dco_Type.RowSource = Ado_Type
  dco_Type.ListField = "TypeName"
  dco_Type.BoundColumn = "TypeId"
  '装入办公用品信息
  Ado_Store.ConnectionString = Conn
  Ado_Store.RecordSource = "Select * From Store Order By OId"
  Ado_Store.Refresh
  Set dco_Store.RowSource = Ado_Store
  dco_Store.ListField = "OName"
  dco_Store.BoundColumn = "OId"
End Sub
Private Sub Refresh_Type()
  If Len(Trim(dco_UType.Text)) > 0 Then
    Ado_Type.ConnectionString = Conn
    Ado_Type.RecordSource = "Select * From Types Where UpperId=" + Trim(dco_UType.BoundText()) + " Order By TypeId"
    Ado_Type.Refresh
    Set dco_Type.RowSource = Ado_Type
    dco_Type.ListField = "TypeName"
    dco_Type.BoundColumn = "TypeId"
    dco_Type.Text = ""
  End If
End Sub

⌨️ 快捷键说明

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