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

📄 frmqueryinput.frm

📁 此为我2001年为东莞建发楦头开发的企业管理软件他们使用至今,望斑竹指教! 其他会员最好不要随意下载,需经斑竹同意或我本人同意,谢谢!
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmQueryInput 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "进料单查询"
   ClientHeight    =   7425
   ClientLeft      =   420
   ClientTop       =   945
   ClientWidth     =   11325
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7425
   ScaleWidth      =   11325
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Sure 
      Caption         =   "查找"
      Height          =   390
      Left            =   10275
      TabIndex        =   3
      Top             =   120
      Width           =   840
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      Left            =   120
      Style           =   2  'Dropdown List
      TabIndex        =   2
      Top             =   165
      Width           =   1530
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   1740
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   165
      Width           =   840
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800000&
      Height          =   360
      Left            =   2655
      MaxLength       =   50
      TabIndex        =   0
      Top             =   135
      Width           =   7470
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   5415
      Left            =   120
      TabIndex        =   4
      Top             =   720
      Width           =   11055
      _ExtentX        =   19500
      _ExtentY        =   9551
      _Version        =   393216
      AllowUserResizing=   1
   End
   Begin VB.Label Label6 
      Caption         =   "0"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1680
      TabIndex        =   10
      Top             =   6960
      Width           =   6735
   End
   Begin VB.Label Label5 
      Caption         =   "库存总数量:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   6960
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "进料总金额:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   120
      TabIndex        =   8
      Top             =   6600
      Width           =   1455
   End
   Begin VB.Label Label4 
      Caption         =   "0"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1680
      TabIndex        =   7
      Top             =   6600
      Width           =   6735
   End
   Begin VB.Label Label2 
      Caption         =   "0"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1680
      TabIndex        =   6
      Top             =   6240
      Width           =   6735
   End
   Begin VB.Label Label1 
      Caption         =   "进料总数量:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   6240
      Width           =   1455
   End
End
Attribute VB_Name = "frmQueryInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim TempStr, TempString As String
Dim rsmaterial As Recordset
Private Sub Form_Load()
    Dim rsmaterial As Recordset
    Dim i, j As Integer
            
    MSFlexGrid1.Cols = 11
    MSFlexGrid1.Row = 0
    MSFlexGrid1.Col = 0
    MSFlexGrid1.Text = "序号"
    MSFlexGrid1.ColWidth(0) = 600
    MSFlexGrid1.Col = 1
    MSFlexGrid1.Text = "进料单号"
    MSFlexGrid1.ColWidth(1) = 1200
    MSFlexGrid1.Col = 2
    MSFlexGrid1.Text = "进料日期"
    MSFlexGrid1.ColWidth(2) = 1200
    MSFlexGrid1.Col = 3
    MSFlexGrid1.Text = "物料编码"
    MSFlexGrid1.ColWidth(3) = 1000
    MSFlexGrid1.Col = 4
    MSFlexGrid1.Text = "物料类型"
    MSFlexGrid1.ColWidth(4) = 1000
    MSFlexGrid1.Col = 5
    MSFlexGrid1.Text = "物料名称"
    MSFlexGrid1.ColWidth(5) = 1000
    MSFlexGrid1.Col = 6
    MSFlexGrid1.Text = "进料数"
    MSFlexGrid1.ColWidth(6) = 1000
    MSFlexGrid1.Col = 7
    MSFlexGrid1.Text = "领/退料数"
    MSFlexGrid1.ColWidth(7) = 1000
    MSFlexGrid1.Col = 8
    MSFlexGrid1.Text = "计量单位"
    MSFlexGrid1.ColWidth(8) = 1000
    MSFlexGrid1.Col = 9
    MSFlexGrid1.Text = "进料单价"
    MSFlexGrid1.ColWidth(9) = 1000
    MSFlexGrid1.Col = 10
    MSFlexGrid1.Text = "备注说明"
    MSFlexGrid1.ColWidth(10) = 1000
    
    Combo1.AddItem "等于", 0
    Combo1.AddItem "包含", 1
    Combo1.ListIndex = 1
    'FindOk = False
    Combo2.AddItem "进料单号", 0
    Combo2.AddItem "物料编码", 1
    Combo2.AddItem "物料类型", 2
    Combo2.AddItem "物料名称", 3
    Combo2.AddItem "进料日期", 4
    Combo2.ListIndex = 0
    Me.Icon = frmain.Icon
End Sub

Private Sub Form_Resize()
On Error Resume Next
Top = frmain.Top + (frmain.Height - Me.Height - 1000) / 2
Left = 50

End Sub


Private Sub Sure_Click()
If Trim(Text1.Text) = "" Then
    TempStr = "select * from input"
    TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input"
Else
Select Case Combo1.Text

   Case "等于"
      Select Case Combo2.Text
           Case "进料单号"
             TempStr = "select * from input where input_no='" & Trim(Text1.Text) & "'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where input_no='" & Trim(Text1.Text) & "'"
           Case "物料编码"
             TempStr = "select * from input where material_no='" & Trim(Text1.Text) & "'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where material_no='" & Trim(Text1.Text) & "'"
           Case "物料类型"
             TempStr = "select * from input where material_type='" & Trim(Text1.Text) & "'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where material_type='" & Trim(Text1.Text) & "'"
           Case "物料名称"
             TempStr = "select * from input where material_name='" & Trim(Text1.Text) & "'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where material_name='" & Trim(Text1.Text) & "'"
           Case "进料日期"
             TempStr = "select * from input where input_date='" & Trim(Text1.Text) & "'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where input_date='" & Trim(Text1.Text) & "'"
      End Select
      
        
  Case "包含"
  
      Select Case Combo2.Text
          Case "进料单号"
             TempStr = "select * from input where input_no Like '%" & Trim(Text1.Text) & "%'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where input_no Like '%" & Trim(Text1.Text) & "%'"
          Case "物料编码"
             TempStr = "select * from input where material_no Like '%" & Trim(Text1.Text) & "%'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where material_no Like '%" & Trim(Text1.Text) & "%'"
           Case "物料类型"
             TempStr = "select * from input where material_type Like '%" & Trim(Text1.Text) & "%'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where material_type Like '%" & Trim(Text1.Text) & "%'"
          Case "物料名称"
             TempStr = "select * from input where material_name Like '%" & Trim(Text1.Text) & "%'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where material_name Like '%" & Trim(Text1.Text) & "%'"
          Case "进料日期"
             TempStr = "select * from input where input_date Like '%" & Trim(Text1.Text) & "%'"
             TempString = "select sum(input_qty),sum(input_qty*material_price),sum(input_qty-output_qty) from input where input_date Like '%" & Trim(Text1.Text) & "%'"
    End Select
 End Select
 End If
 
    Set rsmaterial = New Recordset
    
    
    rsmaterial.Open TempStr, db
    On Error Resume Next
    rsmaterial.MoveFirst
    If rsmaterial.BOF And rsmaterial.EOF Then
        MSFlexGrid1.Rows = 1
        MsgBox "对不起,没有找到您需要的记录!", , "提示"
        Label2.Caption = 0
        Label4.Caption = 0
        Label6.Caption = 0
        rsmaterial.Close
        Exit Sub
    End If
    i = 1
    Do Until rsmaterial.EOF
        MSFlexGrid1.Rows = i + 1
        MSFlexGrid1.Row = i
        MSFlexGrid1.Col = 0
        MSFlexGrid1.Text = i
        For j = 1 To 10
            MSFlexGrid1.Col = j
            MSFlexGrid1.Text = rsmaterial(j - 1)
        Next
        rsmaterial.MoveNext
        i = i + 1
    Loop
    rsmaterial.Close
    
    rsmaterial.Open TempString, db, adOpenStatic, adLockOptimistic
    
    If rsmaterial.RecordCount = 1 Then Label2.Caption = Format(rsmaterial.Fields(0), "#,##0.00"): Label4.Caption = Format(rsmaterial.Fields(1), "#,##0.00"): Label6.Caption = Format(rsmaterial.Fields(2), "#,##0.00"): rsmaterial.Close Else rsmaterial.Close
End Sub

Private Sub Text1_Change()
'If Trim(Text1.Text) = "" Then
'Sure.Enabled = False
'Else
'Sure.Enabled = True
'End If

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Sure.Enabled = True Then Sure.SetFocus
End If

End Sub




⌨️ 快捷键说明

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