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

📄 frmrkhz.frm

📁 一个小型的进销存管理软件,数据采用ACCE
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form FrmRKHZ 
   Caption         =   "入库单汇总"
   ClientHeight    =   7590
   ClientLeft      =   3480
   ClientTop       =   1935
   ClientWidth     =   11445
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   7590
   ScaleWidth      =   11445
   Begin VB.Frame Frame3 
      Caption         =   "根据入库单编号查询"
      Height          =   975
      Left            =   8520
      TabIndex        =   14
      Top             =   0
      Width           =   2895
      Begin VB.TextBox TxtRKDBH 
         Appearance      =   0  'Flat
         Height          =   330
         Left            =   120
         TabIndex        =   16
         Top             =   382
         Width           =   1695
      End
      Begin VB.CommandButton Command8 
         Caption         =   "查   询"
         Height          =   375
         Left            =   1920
         TabIndex        =   15
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.CommandButton Command7 
      Caption         =   "退   出"
      Height          =   375
      Left            =   9960
      TabIndex        =   13
      Top             =   5880
      Width           =   1095
   End
   Begin VB.CommandButton Command6 
      Caption         =   "打印入库单"
      Height          =   375
      Left            =   8640
      TabIndex        =   12
      Top             =   5880
      Width           =   1095
   End
   Begin VB.CommandButton Command5 
      Caption         =   "刷  新"
      Height          =   375
      Left            =   9960
      TabIndex        =   11
      Top             =   5280
      Width           =   1095
   End
   Begin VB.CommandButton Command4 
      Caption         =   "打印汇总"
      Height          =   375
      Left            =   8640
      TabIndex        =   10
      Top             =   5280
      Width           =   1095
   End
   Begin VB.CommandButton Command3 
      Caption         =   "删  除"
      Height          =   375
      Left            =   9960
      TabIndex        =   9
      Top             =   4680
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "详细信息"
      Height          =   375
      Left            =   8640
      TabIndex        =   8
      Top             =   4680
      Width           =   1095
   End
   Begin VB.Frame Frame2 
      Caption         =   "按时间查询"
      Height          =   1815
      Left            =   8520
      TabIndex        =   2
      Top             =   1080
      Width           =   2895
      Begin VB.CommandButton Command1 
         Caption         =   "查  询"
         Height          =   375
         Left            =   840
         TabIndex        =   7
         Top             =   1320
         Width           =   1215
      End
      Begin MSComCtl2.DTPicker DTP2 
         Height          =   330
         Left            =   840
         TabIndex        =   6
         Top             =   840
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   582
         _Version        =   393216
         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
         Format          =   25296897
         CurrentDate     =   38411
      End
      Begin MSComCtl2.DTPicker DTP1 
         Height          =   330
         Left            =   840
         TabIndex        =   5
         Top             =   360
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   582
         _Version        =   393216
         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
         Format          =   25296897
         CurrentDate     =   38411
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "到:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   4
         Top             =   900
         Width           =   420
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "从:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   3
         Top             =   420
         Width           =   420
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "入库单汇总表"
      Height          =   7575
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   8295
      Begin MSFlexGridLib.MSFlexGrid Grid 
         Height          =   7215
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   8055
         _ExtentX        =   14208
         _ExtentY        =   12726
         _Version        =   393216
         Cols            =   5
         FixedCols       =   0
         RowHeightMin    =   315
         SelectionMode   =   1
         FormatString    =   "入库单号码|^ 入 库 日 期 |^入 库 方 式|^仓 库 名 称|^入库总金额"
      End
   End
End
Attribute VB_Name = "FrmRKHZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim CmdFlag As Integer
Dim SQLTJ As String
Private Sub Command1_Click()
    If DTP1 > DTP2 Then
        MsgBox "请正确选择日期,终止日期不能小于起始日期!", vbOKOnly + vbCritical, "提示"
    Else
        SQLTJ = " where rkrq>=#" & DTP1 & "# and rkrq<=#" & DTP2 & "#"
        CmdFlag = 2
        Call ReSet
        Call FillGrid
    End If
End Sub

Private Sub Command2_Click()
    Set RstQD = New ADODB.Recordset
        SQL = "select * from rkcx where RKD_MX.RKD_ID='" & Grid.TextMatrix(Grid.RowSel, 0) & "'"
        RstQD.Open SQL, db, 1, 3
        
    If RstQD.EOF Then Exit Sub
    
    FrmRKQD.LblRKDH.Caption = RstQD.Fields(0)
    FrmRKQD.lblRKLX.Caption = RstQD.Fields(1)
    FrmRKQD.lblRKRQ.Caption = RstQD.Fields(2)
    FrmRKQD.LblCKMC.Caption = RstQD.Fields(3)
    FrmRKQD.lblZJE.Caption = Format(RstQD.Fields(12), "0.00")

    FrmRKQD.Grid.Clear
    FrmRKQD.Grid.Rows = 1
    FrmRKQD.Grid.FormatString = "序号|^   商   品   名   称    |^  货   号  |^  规   格   |^  单   位  |^  数   量  |^  单   价  |^  金    额     "

    Do While Not RstQD.EOF
        FrmRKQD.Grid.Rows = FrmRKQD.Grid.Rows + 1
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 0) = RstQD.Fields(4)
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 1) = RstQD.Fields(5)
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 2) = RstQD.Fields(6)
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 3) = RstQD.Fields(7)
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 4) = RstQD.Fields(8)
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 5) = RstQD.Fields(9)
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 6) = Format(RstQD.Fields(10), "0.00")
        FrmRKQD.Grid.TextMatrix(FrmRKQD.Grid.Rows - 1, 7) = Format(RstQD.Fields(11), "0.00")
        SumSL = SumSL + RstQD.Fields(9)
        RstQD.MoveNext
    Loop
    FrmRKQD.lblSL.Caption = SumSL
    FrmRKQD.Show 1
End Sub

Private Sub Command5_Click()
    Call ReSet
    Call FillGrid
End Sub

Private Sub Command7_Click()
    Unload Me
End Sub

Private Sub Command8_Click()
    If TxtRKDBH <> "" Then
        SQLTJ = " where rkdbh='" & Trim(TxtRKDBH) & "'"
        CmdFlag = 1
        Call ReSet
        Call FillGrid
    End If
End Sub

Private Sub Form_Load()
    CmdFlag = 0
    Call ReSet
    Call FillGrid
End Sub
Sub ReSet()
    Grid.Clear
    Grid.Rows = 1
    Grid.FormatString = "入 库 单 号 码|^ 入 库 日 期 |^入 库 方 式|^仓 库 名 称|^入库总金额"
End Sub
Sub FillGrid()
    Set Rst = New Recordset
        SQL = "select * from RKD_ZB" & SQLTJ & " order by rkdbh"
        Rst.Open SQL, db, 1, 3
        
    If Rst.EOF Then
        If CmdFlag = 1 Then
            MsgBox "找不到此入库单,请确认入库单编号输入正确!", vbOKOnly + vbInformation, "提示"
        ElseIf CmdFlag = 2 Then
            MsgBox "在此日期段无入库单!", vbOKOnly + vbInformation, "提示"
        End If
        SQLTJ = ""
        Exit Sub
    End If
    
    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(4)
        Grid.TextMatrix(Grid.Rows - 1, 4) = Format(Rst.Fields(5), "0.00")
        Rst.MoveNext
    Loop
    
    SQLTJ = ""
    CmdFlag = 0
End Sub

Private Sub Grid_DblClick()
    Call Command2_Click
End Sub

Private Sub Grid_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Call Command2_Click
    End If
End Sub

⌨️ 快捷键说明

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