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

📄 frmwaterinfo.frm

📁 纯净水进销存管理系统 Ver 2.0是专本针对售水行业的一个进销存软件
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmWaterInfo 
   Caption         =   "饮水机类型设置"
   ClientHeight    =   5970
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7785
   LinkTopic       =   "Form1"
   ScaleHeight     =   5970
   ScaleWidth      =   7785
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Height          =   975
      Left            =   120
      TabIndex        =   2
      Top             =   4920
      Width           =   7575
      Begin VB.CommandButton Command1 
         Caption         =   "添加"
         Height          =   375
         Left            =   480
         TabIndex        =   6
         Top             =   360
         Width           =   1335
      End
      Begin VB.CommandButton Command2 
         Caption         =   "修改"
         Height          =   375
         Left            =   2205
         TabIndex        =   5
         Top             =   360
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         Caption         =   "删除"
         Height          =   375
         Left            =   3915
         TabIndex        =   4
         Top             =   360
         Width           =   1335
      End
      Begin VB.CommandButton Command4 
         Caption         =   "返回"
         Height          =   375
         Left            =   5640
         TabIndex        =   3
         Top             =   360
         Width           =   1335
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "饮水机浏览"
      Height          =   4455
      Left            =   120
      TabIndex        =   0
      Top             =   360
      Width           =   7575
      Begin MSFlexGridLib.MSFlexGrid msgList 
         Height          =   4095
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   7335
         _ExtentX        =   12938
         _ExtentY        =   7223
         _Version        =   393216
         AllowUserResizing=   1
      End
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "饮水机类型浏览"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800000&
      Height          =   255
      Left            =   2760
      TabIndex        =   7
      Top             =   120
      Width           =   2295
   End
End
Attribute VB_Name = "frmWaterInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2006/12/06
'描    述: 纯净水进销存管理系统 Ver 2.0
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Private Sub Command1_Click()
Load frmWater
frmWater.Show
End Sub

Private Sub Command2_Click()
Dim intCount As Integer
Dim txtsql As String
    If msgList.Rows > 1 Then
        'gintDHmode = 2
        intCount = msgList.Row
        If intCount > 0 Then
           txtsql = "select * from 饮水机 where 饮水机编号 ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
           wmEdit = 1
           Load frmWater
           frmWater.showdata (txtsql)
           frmWater.Show 1, frmWaterInfo
        Else
            MsgBox "警告", vbOKOnly + vbExclamation, "请首先选择需要修改的纪录!"
        End If
    End If
End Sub

Private Sub Command3_Click()
 Dim txtsql As String
    Dim intCount As Integer
    Dim MsgText As String

    If msgList.Rows > 1 Then
        If MsgBox("确认要删除编号为" & Trim(msgList.TextMatrix(msgList.Row, 1)) & "的供应商记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
            intCount = msgList.Row
            txtsql = "delete from 饮水机 where 饮水机编号='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
            ExeSQL (txtsql)
            '**********删除与之相关的所有数据************
            'txtsql = "delete from 饮水机维护表 where 饮水机编号 =" & Trim(msgList.TextMatrix(intCount, 1))
            'ExeSQL (txtsql)
            MsgBox "记录删除成功!", vbInformation, "系统提示"
            Call showdata
            msgList.Refresh
        End If
    End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Form_Load()
Call ShowTitle
Call showdata
End Sub
'显示Grid表头
Public Sub ShowTitle()
    Dim i As Integer
    With msgList
        .Cols = 6
        .TextMatrix(0, 1) = "饮水机编号"
        .TextMatrix(0, 2) = "饮水机名称"
        .TextMatrix(0, 3) = "零售价"
        .TextMatrix(0, 4) = "供应商名称"
        .TextMatrix(0, 5) = "备注"
        
        '固定表头
        .FixedRows = 1
                
        '设置各列的对齐方式
        For i = 0 To 5
            .ColAlignment(i) = 0
        Next i
        
        
        '表头项居中
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
        
        '设置单元大小
        .ColWidth(0) = 500
        .ColWidth(1) = 1000
        .ColWidth(2) = 1000
        .ColWidth(3) = 1000
        .ColWidth(4) = 3000
        .ColWidth(5) = 5000
        .Row = 1
        
    End With
End Sub

Private Sub msgList_EnterCell()
msgList.SelectionMode = flexSelectionByRow
End Sub

Public Sub showdata()
    Dim j As Integer
    Dim i As Integer
    Dim sqlshow As String
    Dim mrc As ADODB.Recordset
    sqlshow = "select * from 饮水机"
    Set mrc = ExeSQL(sqlshow)
     If mrc.EOF Then
        frmWater.Show 1, frmWaterInfo
        mrc.Close
        Set mrc = Nothing
        Exit Sub
    End If
    With msgList
        .Rows = 1
        
        Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 1 To mrc.Fields.Count
                If Not IsNull(Trim(mrc.Fields(i - 1))) Then
                Select Case mrc.Fields(i - 1).Type
                    Case adDBDate
                        .TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
                    Case Else
                        .TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
                End Select
                End If
            Next i
            mrc.MoveNext
        Loop
        
          
    End With
    mrc.Close
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set frmWaterInfo = Nothing
End Sub

⌨️ 快捷键说明

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