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

📄 frmcksz.frm

📁 一个小型的进销存管理软件,数据采用ACCE
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   End
   Begin MSFlexGridLib.MSFlexGrid Grid 
      Height          =   4815
      Left            =   0
      TabIndex        =   2
      Top             =   360
      Width           =   9855
      _ExtentX        =   17383
      _ExtentY        =   8493
      _Version        =   393216
      Cols            =   6
      FixedCols       =   0
      RowHeightMin    =   315
      SelectionMode   =   1
      FormatString    =   "仓库编码|^   仓  库  名  称  |^       地        址            |^    房    东    |^ 联 系 电 话 |^月租金(欧元)"
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   4680
      Top             =   1680
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmCKSZ.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmCKSZ.frx":031A
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmCKSZ.frx":076C
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmCKSZ.frx":08C6
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   1
      Top             =   5175
      Width           =   9855
      _ExtentX        =   17383
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   1
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   360
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   9855
      _ExtentX        =   17383
      _ExtentY        =   635
      ButtonWidth     =   1349
      ButtonHeight    =   582
      Style           =   1
      TextAlignment   =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   5
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "增加"
            Key             =   "Add"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Key             =   "Del"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            Key             =   "Modify"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   1
            Style           =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "退出"
            Key             =   "Exit"
            ImageIndex      =   1
         EndProperty
      EndProperty
      BorderStyle     =   1
   End
End
Attribute VB_Name = "FrmCKSZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Rst As ADODB.Recordset
Private Sub cmdOK_Click()
    On Error GoTo HandleErrors:
    
    Rst.Fields(0) = TxtCKID.Text
    Rst.Fields(1) = TxtCKMC.Text
    Rst.Fields(2) = TxtAddress.Text
    Rst.Fields(3) = TxtFD.Text
    Rst.Fields(4) = TxtLXDH.Text
    Rst.Fields(5) = TxtYZJ.Text
    
    Rst.Update
    
    Frame1.Visible = False
    Toolbar1.Enabled = True
    Grid.Enabled = True
    
    Call ReSet
    Call FillGrid
    
    Exit Sub
HandleErrors:
    MsgBox Err.Description, vbOKOnly + vbCritical
End Sub

Private Sub CmdReturn_Click()
    On Error GoTo HandleErrors:
    
    Frame1.Visible = False
    Toolbar1.Enabled = True
    Grid.Enabled = True
    
    Exit Sub
HandleErrors:
    MsgBox Err.Description, vbOKOnly + vbCritical
End Sub

Private Sub Form_Load()
    Frame1.Visible = False
       
    Call ReSet
    Call FillGrid
End Sub
Sub ReSet()
    Grid.Clear
    Grid.Rows = 1
    Grid.FormatString = "仓库编码|^   仓  库  名  称  |^       地        址            |^    房    东    |^ 联 系 电 话 |^月租金(欧元)"
End Sub
Sub FillGrid()
    On Error GoTo HandleErrors:
    
    Set Rst = New ADODB.Recordset
        SQL = "select * from ck"
        Rst.Open SQL, db, 1, 3
        
        If Rst.EOF Then Exit Sub

    Call ReSet
    
    Do While Not Rst.EOF
         Grid.Rows = Grid.Rows + 1
         Grid.TextMatrix(Grid.Rows - 1, 0) = Rst.Fields(0)
         Grid.TextMatrix(Grid.Rows - 1, 1) = Rst.Fields(1)
         Grid.TextMatrix(Grid.Rows - 1, 2) = Rst.Fields(2)
         Grid.TextMatrix(Grid.Rows - 1, 3) = Rst.Fields(3)
         Grid.TextMatrix(Grid.Rows - 1, 4) = Rst.Fields(4)
         Grid.TextMatrix(Grid.Rows - 1, 5) = Format(Rst.Fields(5), "0.00")
         Rst.MoveNext
     Loop
    
    Rst.Close
    Set Rst = Nothing
    Exit Sub
HandleErrors:
    MsgBox Err.Description
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    Select Case Button.Key
        Case Is = "Add"
            Call DataAdd
        Case Is = "Del"
            Call DataDel
        Case Is = "Modify"
            Call DataModify
        Case Is = "Exit"
            Unload Me
    End Select
End Sub
Sub DataAdd()
    Dim LastCKID As Integer
    Dim RstID As Recordset
    
    Frame1.Visible = True
    Toolbar1.Enabled = False
    Grid.Enabled = False
    
    Call ResetTxt
    
    On Error GoTo ErrHandle
        Set RstID = New Recordset
            SQL = " select max(ckid) from ck"
            RstID.Open SQL, db, 1, 3
            
            If IsNull(RstID.Fields(0)) Then
                LastCKID = 1
            Else
                LastCKID = RstID.Fields(0) + 1
            End If
            
        Set Rst = New Recordset
            SQL = "select * from ck"
            Rst.Open SQL, db, 1, 3
            
            Rst.AddNew
        
        TxtCKID.Text = LastCKID
        TxtCKMC.SetFocus
        
    Exit Sub
ErrHandle:
    MsgBox Err.Description
End Sub
Sub DataModify()
    Frame1.Visible = True
    Frame1.Caption = "仓库修改"
    Grid.Enabled = False
    Set Rst = New ADODB.Recordset
        SQL = "select * from ck where ckid=" & Grid.TextMatrix(Grid.RowSel, 0)
        Rst.Open SQL, db, 1, 3
        
        If Rst.EOF Then Exit Sub
        
        TxtCKID = Rst.Fields(0)
        TxtCKMC = Rst.Fields(1)
        TxtAddress = Rst.Fields(2)
        TxtFD = Rst.Fields(3)
        TxtLXDH = Rst.Fields(4)
        TxtYZJ = Rst.Fields(5)
        
        TxtCKMC.SetFocus
End Sub
Sub DataDel()
    Dim RstCheck As ADODB.Recordset
    On Error GoTo HandleErrors:
    Set RstCheck = New Recordset
        SQL = "select * from kcdtb where ckid=" & Grid.TextMatrix(Grid.RowSel, 0) & " and sl<>0"
        RstCheck.Open SQL, db, 1, 3
        
        If Not RstCheck.EOF Then
            MsgBox "不能删除此仓库,仓库中还有商品!", vbOKOnly + vbExclamation, "警告"
            Exit Sub
        End If
        
        If MsgBox("请确认要删除此仓库?", vbOKCancel + 48, "警告") = vbOK Then
            Set Rst = New Recordset
                SQL = "delete * from ck where ckid=" & Grid.TextMatrix(Grid.RowSel, 0)
                Rst.Open SQL, db, 1, 3
                
                Call ReSet
                Call FillGrid
        End If
    Exit Sub
HandleErrors:
    MsgBox Err.Description, vbOKOnly + vbCritical
End Sub
Sub ResetTxt()
    TxtCKID = ""
    TxtCKMC = ""
    TxtAddress = ""
    TxtFD = ""
    TxtLXDH = ""
    TxtYZJ = ""
End Sub

⌨️ 快捷键说明

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