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

📄 frmstock2.frm

📁 一个贸易公司的管理信息系统 我的毕业设计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmStock2 
   Caption         =   "进货信息查询"
   ClientHeight    =   1548
   ClientLeft      =   48
   ClientTop       =   348
   ClientWidth     =   3744
   LinkTopic       =   "Form1"
   ScaleHeight     =   1548
   ScaleWidth      =   3744
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox txtNo 
      Height          =   270
      Left            =   120
      TabIndex        =   8
      TabStop         =   0   'False
      Top             =   1920
      Visible         =   0   'False
      Width           =   735
   End
   Begin VB.CheckBox chkItem 
      Caption         =   "Check1"
      Height          =   180
      Index           =   1
      Left            =   120
      TabIndex        =   5
      TabStop         =   0   'False
      Top             =   480
      Width           =   132
   End
   Begin VB.ComboBox Combo1 
      Height          =   288
      Left            =   1440
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   480
      Width           =   2172
   End
   Begin VB.CheckBox chkItem 
      Caption         =   "Check1"
      Height          =   180
      Index           =   0
      Left            =   120
      TabIndex        =   3
      TabStop         =   0   'False
      Top             =   120
      Value           =   1  'Checked
      Width           =   132
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定 (&O)"
      Default         =   -1  'True
      Height          =   375
      Left            =   600
      TabIndex        =   2
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "取消 (&X)"
      Height          =   375
      Left            =   2160
      TabIndex        =   1
      Top             =   1080
      Width           =   1215
   End
   Begin VB.TextBox txtItem 
      Height          =   270
      Index           =   0
      Left            =   1440
      TabIndex        =   0
      Top             =   120
      Width           =   2172
   End
   Begin VB.Label lblitem 
      Caption         =   "供应商名称:"
      Height          =   252
      Index           =   1
      Left            =   480
      TabIndex        =   7
      Top             =   480
      Width           =   1092
   End
   Begin VB.Label lblitem 
      Caption         =   "商 品 名  称:"
      Height          =   252
      Index           =   0
      Left            =   480
      TabIndex        =   6
      Top             =   120
      Width           =   1092
   End
End
Attribute VB_Name = "frmStock2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub chkItem_Click(Index As Integer)
    If Index = 0 Then
        txtItem(0).SetFocus
    Else
        Combo1.SetFocus
    End If
End Sub

Private Sub cmdExit_Click()
    Me.Hide
End Sub

Private Sub cmdOK_Click()
    Dim sQSql As String
    
    
    If chkItem(0).Value = vbChecked Then
        sQSql = " ProductName = '" & Trim(txtItem(0) & " ") & "'"
    End If
    
    
    If chkItem(1).Value = vbChecked Then
        If Trim(sQSql & " ") = "" Then
            sQSql = " ProviderID ='" & Trim(txtNo & " ") & "'"
        Else
            sQSql = sQSql & " and ProviderID ='" & Trim(txtNo & " ") & "'"
        End If
    End If
  
    If Trim(sQSql) = "" Then
        MsgBox "请设置查询条件!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
    Else
        If flagSedit Then
            Unload frmStock
        End If
        frmStock.txtSQL = "select * from sstock where" & sQSql
        frmStock.Show
    End If
    Me.Hide
End Sub



Private Sub Combo1_Click()
    Dim txtSQL As String
    Dim MsgText As String
    Dim mrcc As ADODB.Recordset
    
    txtSQL = "select SupplierID from suppliers where CompanyName = '" & Trim(Combo1) & "'"
    Set mrcc = ExecuteSQL(txtSQL, MsgText)
    
    If Not mrcc.EOF Then
        txtNo = mrcc.Fields(0)
    End If
    
    mrcc.Close
End Sub

Private Sub Form_Load()
    
    
    Dim i As Integer
    Dim j As Integer
    Dim sSql As String
    Dim txtSQL As String
    Dim MsgText As String
    Dim mrc As ADODB.Recordset
    
    Combo1.Clear
    txtSQL = "select DISTINCT CompanyName from suppliers"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
        
    If Not mrc.EOF Then
            
        Do While Not mrc.EOF
            Combo1.AddItem Trim(mrc.Fields(0))
            mrc.MoveNext
        Loop
        
            
    Else
        MsgBox "请先进行供应商设置!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
    End If
    mrc.Close
End Sub

Private Sub lblitem_Click(Index As Integer)
    chkItem(Index).Value = vbChecked
    
End Sub

Private Sub txtItem_GotFocus(Index As Integer)
   
    txtItem(Index).SelStart = 0
    txtItem(Index).SelLength = Len(txtItem(Index))
End Sub


⌨️ 快捷键说明

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