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

📄 frmkc.frm

📁 vb写得进销存
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmKC.frx":11C9
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmKC.frx":2ED3
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmKC.frx":59DD
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   795
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   9360
      _ExtentX        =   16510
      _ExtentY        =   1402
      ButtonWidth     =   1455
      ButtonHeight    =   1349
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   6
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "检索库存"
            ImageIndex      =   12
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "全部信息"
            ImageIndex      =   11
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "打印"
            ImageIndex      =   10
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "退出"
            ImageIndex      =   9
         EndProperty
      EndProperty
      BorderStyle     =   1
      Begin MSComctlLib.ImageList ImageList1 
         Left            =   5325
         Top             =   285
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   32
         ImageHeight     =   32
         MaskColor       =   12632256
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   12
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":86E7
               Key             =   ""
            EndProperty
            BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":8B3B
               Key             =   ""
            EndProperty
            BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":8F8F
               Key             =   ""
            EndProperty
            BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":93E3
               Key             =   ""
            EndProperty
            BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":9837
               Key             =   ""
            EndProperty
            BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":9C8B
               Key             =   ""
            EndProperty
            BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":A0DF
               Key             =   ""
            EndProperty
            BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":A533
               Key             =   ""
            EndProperty
            BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":A987
               Key             =   ""
            EndProperty
            BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":D691
               Key             =   ""
            EndProperty
            BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":F39B
               Key             =   ""
            EndProperty
            BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmKC.frx":11EA5
               Key             =   ""
            EndProperty
         EndProperty
      End
   End
End
Attribute VB_Name = "frmKC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'16

Public InitSQL As String
Private Sub Combo1_Change()
On Error GoTo eH
    Combo2.Text = ""
    Combo2.Clear
    If g_rst.State = 1 Then g_rst.Close
    g_rst.Open "select distinct(" & Combo1.Text & ") as m from 货品资料"
    While Not g_rst.EOF
        If Not IsNull(g_rst!m) Then Combo2.AddItem g_rst!m
        g_rst.MoveNext
    Wend
Exit Sub
eH:
    MsgBox em & vbNewLine & "错误号:1601" & vbNewLine & "错误描述:" & Err.Description

End Sub

Private Sub Combo1_Click()
On Error GoTo eH
    Combo2.Text = ""
    Combo2.Clear
    If g_rst.State = 1 Then g_rst.Close
    g_rst.Open "select distinct(" & Combo1.Text & ") as m from 货品资料"
    While Not g_rst.EOF
        If Not IsNull(g_rst!m) Then Combo2.AddItem g_rst!m
        g_rst.MoveNext
    Wend
Exit Sub
eH:
    MsgBox em & vbNewLine & "错误号:1602" & vbNewLine & "错误描述:" & Err.Description

End Sub

Private Sub Command1_Click()
    If Combo1.Text = "" Then Exit Sub
    ADO.RecordSource = "select * from 货品资料,货品库存 where 货品资料.货品代码=货品库存.货品代码 and 货品资料." & Combo1.Text & "='" & Combo2.Text & "' order by 货品资料.货品代码 asc"
    ADO.Refresh
    ColorMFG
End Sub

Private Sub Form_Load()
On Error GoTo eH
    If InitSQL = "" Then InitSQL = "select * from 货品资料,货品库存 where 货品资料.货品代码=货品库存.货品代码 order by 货品资料.货品代码 asc"
    ADO.ConnectionString = g_cnnStr
    ADO.RecordSource = InitSQL
    ADO.Refresh
    ColorMFG
Exit Sub
eH:
    MsgBox em & vbNewLine & "错误号:1603" & vbNewLine & "错误描述:" & Err.Description

End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error GoTo eH
    Select Case Button.Index
        Case 2
            ADO.RecordSource = "select * from 货品资料,货品库存 where (库存数量>最高库存 or 库存数量<最底库存) and 货品资料.货品代码=货品库存.货品代码 order by 货品资料.货品代码 asc"
            ADO.Refresh
            ColorMFG
        Case 3
            ADO.RecordSource = "select * from 货品资料,货品库存 where 货品资料.货品代码=货品库存.货品代码 order by 货品资料.货品代码 asc"
            ADO.Refresh
            ColorMFG
        Case 6
            Unload Me
        Case 4
            If DE.rsKc.State = 1 Then DE.rsKc.Close
            DE.rsKc.Open ADO.RecordSource
            drKc.Show 1
    End Select
Exit Sub
eH:
    MsgBox em & vbNewLine & "错误号:1604" & vbNewLine & "错误描述:" & Err.Description

End Sub

Public Sub ColorMFG()
On Error GoTo eH
    Dim r, c As Integer
    For r = 1 To MFG.Rows - 1
        If Val(MFG.TextMatrix(r, 3)) < Val(MFG.TextMatrix(r, 2)) Or Val(MFG.TextMatrix(r, 3)) > Val(MFG.TextMatrix(r, 4)) Then
            MFG.Row = r
            For c = 0 To MFG.Cols - 1
                MFG.Col = c
                MFG.CellBackColor = vbYellow
            Next
        End If
    Next
Exit Sub
eH:
    MsgBox em & vbNewLine & "错误号:1605" & vbNewLine & "错误描述:" & Err.Description

End Sub

⌨️ 快捷键说明

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