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

📄 frmqsupplier.frm

📁 超市的管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frmQSupplier 
   BackColor       =   &H00C0E0FF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "供货商查询"
   ClientHeight    =   8280
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   10560
   Icon            =   "frmQSupplier.frx":0000
   LinkTopic       =   "Form5"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   8280
   ScaleWidth      =   10560
   Begin VB.CommandButton CmdModify 
      Caption         =   "修 改(&M)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4080
      TabIndex        =   8
      Top             =   7200
      Width           =   2415
   End
   Begin VB.CommandButton CmdDel 
      Caption         =   "删 除(&D)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   840
      TabIndex        =   7
      Top             =   7200
      Width           =   2415
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0E0FF&
      Caption         =   "请选择查询项目,查询条件"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   2775
      Left            =   240
      TabIndex        =   10
      Top             =   1200
      Width           =   10095
      Begin VB.CommandButton CmdQuery 
         Caption         =   "查 询(&Q)"
         BeginProperty Font 
            Name            =   "幼圆"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   6120
         TabIndex        =   5
         Top             =   2040
         Width           =   2415
      End
      Begin VB.CommandButton CmdINT 
         Caption         =   "初 始 化(&I)"
         BeginProperty Font 
            Name            =   "幼圆"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   1200
         TabIndex        =   6
         Top             =   2040
         Width           =   2415
      End
      Begin VB.TextBox TxtPhone 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   7560
         TabIndex        =   4
         Top             =   1440
         Width           =   2055
      End
      Begin VB.TextBox TxtState 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   7560
         TabIndex        =   3
         Top             =   840
         Width           =   2055
      End
      Begin VB.CheckBox ChkCity 
         BackColor       =   &H00C0E0FF&
         Caption         =   "Check1"
         Height          =   375
         Left            =   5640
         TabIndex        =   15
         Top             =   270
         Width           =   255
      End
      Begin VB.TextBox TxtCity 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   7560
         TabIndex        =   2
         Top             =   240
         Width           =   2055
      End
      Begin VB.CheckBox ChkState 
         BackColor       =   &H00C0E0FF&
         Caption         =   "Check2"
         Height          =   375
         Left            =   5640
         TabIndex        =   14
         Top             =   840
         Width           =   255
      End
      Begin VB.TextBox TxtNAME 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3000
         TabIndex        =   1
         Top             =   1260
         Width           =   2295
      End
      Begin VB.TextBox TxtID 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3000
         TabIndex        =   0
         Top             =   540
         Width           =   2295
      End
      Begin VB.OptionButton OptSPNAME 
         BackColor       =   &H00C0E0FF&
         Caption         =   "Option1"
         Height          =   180
         Left            =   120
         TabIndex        =   13
         Top             =   1320
         Width           =   255
      End
      Begin VB.OptionButton OptSPID 
         BackColor       =   &H00C0E0FF&
         Caption         =   "Option2"
         Height          =   180
         Left            =   120
         TabIndex        =   12
         Top             =   600
         Width           =   255
      End
      Begin VB.CheckBox ChkPhone 
         BackColor       =   &H00C0E0FF&
         Caption         =   "Check2"
         Height          =   375
         Left            =   5640
         TabIndex        =   11
         Top             =   1410
         Width           =   255
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "LIKE"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   240
         Left            =   2160
         TabIndex        =   24
         Top             =   1320
         Width           =   480
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "LIKE"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   240
         Left            =   2160
         TabIndex        =   23
         Top             =   600
         Width           =   480
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "城 市"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   6000
         TabIndex        =   20
         Top             =   330
         Width           =   600
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "厂 商 编 号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   600
         TabIndex        =   19
         Top             =   600
         Width           =   1320
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "省 份"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   6000
         TabIndex        =   18
         Top             =   900
         Width           =   600
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "厂 商 名 称"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   600
         TabIndex        =   17
         Top             =   1320
         Width           =   1320
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "电 话 号 码"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   6000
         TabIndex        =   16
         Top             =   1470
         Width           =   1320
      End
   End
   Begin VB.CommandButton CmdExit 
      Caption         =   "退 出(&E)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7440
      TabIndex        =   9
      Top             =   7200
      Width           =   2415
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   2895
      Left            =   240
      TabIndex        =   21
      Top             =   4080
      Width           =   10095
      _ExtentX        =   17806
      _ExtentY        =   5106
      _Version        =   393216
      Cols            =   8
      FixedCols       =   0
      AllowUserResizing=   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "厂  商  记  录  查  询"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000080&
      Height          =   480
      Left            =   2760
      TabIndex        =   22
      Top             =   240
      Width           =   5280
   End
End
Attribute VB_Name = "frmQSupplier"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim rct As New ADODB.Recordset                              '声明连接到厂商表的记录集

Dim rct1 As New ADODB.Recordset                             '声明连接到员工权限表的记录集

Dim id As Integer                                           '声明表格中序号变量

Private Sub Check1_Click()

    TxtCity.SetFocus

End Sub

Private Sub Check2_Click()

     TxtPhone.SetFocus

End Sub

Private Sub ChkDate_Click()

    TxtState.SetFocus

End Sub

Private Sub CmdDel_Click()

    Dim str1 As String

    If MSFlexGrid1.Rows > 2 Then                                       '判断表格中是否存在有效记录

        If MSFlexGrid1.Row > 0 And MSFlexGrid1.Row < MSFlexGrid1.Rows - 1 Then          '判断是否选中有效记录
          
            If MsgBox("确定要删除该记录吗?", vbInformation + vbOKCancel, "操作警告!") = vbOK Then
              
                str1 = "delete from suppliers  where suppliersid=" & "'" & MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) & "'"
                          
                QueryXFInfo (str1)
                
                '依次将表格中所删记录后面的所有记录覆盖前一个记录,然后删除最后一个记录。
                
                For id = MSFlexGrid1.Row To MSFlexGrid1.Rows - 2

                    MSFlexGrid1.TextMatrix(id, 1) = MSFlexGrid1.TextMatrix(id + 1, 1)

                    MSFlexGrid1.TextMatrix(id, 2) = MSFlexGrid1.TextMatrix(id + 1, 2)

                    MSFlexGrid1.TextMatrix(id, 3) = MSFlexGrid1.TextMatrix(id + 1, 3)

                    MSFlexGrid1.TextMatrix(id, 4) = MSFlexGrid1.TextMatrix(id + 1, 4)

                    MSFlexGrid1.TextMatrix(id, 5) = MSFlexGrid1.TextMatrix(id + 1, 5)
                    
                    MSFlexGrid1.TextMatrix(id, 6) = MSFlexGrid1.TextMatrix(id + 1, 6)
                    
                    MSFlexGrid1.TextMatrix(id, 6) = MSFlexGrid1.TextMatrix(id + 1, 7)

                Next id

                MSFlexGrid1.RemoveItem (MSFlexGrid1.Rows - 2)
                    
                MsgBox "已删除所选记录!", vbInformation + vbOKOnly, "删除成功!"
            
            Else
            
                Exit Sub
                
            End If
              
        Else

            MsgBox "无法删除,请点击要删除的记录!", vbInformation + vbOKOnly, "删除提示!"

            Exit Sub

        End If

    Else

        MsgBox "无记录可以删除!", vbInformation + vbOKOnly, "删除提示!"
        
        Exit Sub

⌨️ 快捷键说明

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