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

📄 库存查询.frm

📁 仓库查询系统的管理软件的源代码
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form 库存查询 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "库存查询"
   ClientHeight    =   7065
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5595
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   7065
   ScaleWidth      =   5595
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdExit 
      Caption         =   "退 出"
      Height          =   375
      Left            =   3840
      TabIndex        =   7
      Top             =   1440
      Width           =   1095
   End
   Begin VB.CommandButton cmdClear 
      Caption         =   "取 消"
      Height          =   375
      Left            =   3840
      TabIndex        =   6
      Top             =   840
      Width           =   1095
   End
   Begin VB.CommandButton cmdCheck 
      Caption         =   "确 定"
      Height          =   375
      Left            =   3840
      TabIndex        =   5
      Top             =   240
      Width           =   1095
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   4695
      Left            =   360
      TabIndex        =   4
      Top             =   2040
      Width           =   4815
      _ExtentX        =   8493
      _ExtentY        =   8281
      _Version        =   393216
      Cols            =   3
      AllowUserResizing=   1
      FormatString    =   "^   货物编号   |^      货物名称      |^    库存数量   "
   End
   Begin VB.TextBox txt1 
      Height          =   495
      Left            =   1800
      TabIndex        =   3
      Top             =   1200
      Width           =   1815
   End
   Begin VB.TextBox txt2 
      Height          =   495
      Left            =   1800
      TabIndex        =   2
      Top             =   240
      Width           =   1815
   End
   Begin VB.Label Label2 
      Caption         =   "按名称查询:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   1
      Top             =   1320
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "按编号查询:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   1335
   End
End
Attribute VB_Name = "库存查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub cmdCheck_Click()
    Dim rst As New ADODB.Recordset
    Dim strCheck As String
    Dim strSQL As String
    Dim strItem As String
    
On Error GoTo ErrorExit
    Me.MSFlexGrid1.Rows = 1
    If Me.txt1.Text <> "" Then
        strCheck = " 名称 LIKE '" & Me.txt1.Text & "'"
    End If
    If Me.txt2.Text <> "" Then
        strCheck = " 编号 LIKE '" & Me.txt2.Text & "'"
    End If
    
    
    
    strSQL = "select * from 库存"
    If strCheck <> "" Then
        strSQL = strSQL & " WHERE " & strCheck
    End If
    rst.Open strSQL, cnnDatabase, adOpenStatic, adLockReadOnly
    If rst.RecordCount = 0 Then
        MsgBox "数据库中无相关库存记录!", vbInformation, "请注意"
        Exit Sub
    Else
        rst.MoveFirst
        Do Until rst.EOF
            strItem = rst!编号 & Chr(9) & rst!名称 & Chr(9) & rst!库存总量
            Me.MSFlexGrid1.AddItem strItem
            Me.MSFlexGrid1.ColWidth(2) = 1500
           
            Module1.MSFBackColor Me.MSFlexGrid1, Me.MSFlexGrid1.Rows - 1
        rst.MoveNext
        Loop
    End If
    Set rst = Nothing
    Exit Sub
    
ErrorExit:
    MsgBox Err.Description, vbInformation, Me.Caption
    Set rst = Nothing
End Sub

Private Sub cmdClear_Click()
    Initial
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub Initial()
    Me.txt1 = ""
    Me.txt2 = ""
   
    Me.MSFlexGrid1.Rows = 1
End Sub



⌨️ 快捷键说明

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