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

📄 vb68.tmp

📁 一个关于进销存的源代码
💻 TMP
字号:
VERSION 5.00
Begin VB.Form dlg28 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00FF8080&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "对话框标题"
   ClientHeight    =   3885
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   5130
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3885
   ScaleWidth      =   5130
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FF8080&
      Caption         =   "统 计"
      Height          =   375
      Left            =   3600
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   3360
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.CommandButton Command3 
      BackColor       =   &H00FF8080&
      Caption         =   "精确查询"
      Enabled         =   0   'False
      Height          =   375
      Left            =   1080
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   1200
      Width           =   855
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FF8080&
      Caption         =   "输入线路名称或序号"
      Height          =   1575
      Left            =   240
      TabIndex        =   5
      Top             =   1920
      Visible         =   0   'False
      Width           =   2415
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   240
         TabIndex        =   9
         Top             =   600
         Width           =   1935
      End
      Begin VB.CommandButton Command2 
         BackColor       =   &H00FF8080&
         Caption         =   "确定"
         Height          =   375
         Left            =   840
         MaskColor       =   &H00FF8080&
         Style           =   1  'Graphical
         TabIndex        =   8
         Top             =   1080
         Width           =   615
      End
      Begin VB.OptionButton Option2 
         BackColor       =   &H00FF8080&
         Caption         =   "Like"
         Height          =   255
         Left            =   1440
         TabIndex        =   7
         Top             =   240
         Width           =   735
      End
      Begin VB.OptionButton Option1 
         BackColor       =   &H00FF8080&
         Caption         =   "="
         Height          =   255
         Left            =   480
         TabIndex        =   6
         Top             =   240
         Width           =   615
      End
   End
   Begin VB.ListBox List1 
      Height          =   2940
      Left            =   2880
      TabIndex        =   4
      Top             =   240
      Width           =   2055
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      ItemData        =   "dlg28.frx":0000
      Left            =   960
      List            =   "dlg28.frx":0002
      TabIndex        =   3
      Top             =   720
      Width           =   1695
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "dlg28.frx":0004
      Left            =   960
      List            =   "dlg28.frx":000B
      TabIndex        =   2
      Top             =   240
      Width           =   1695
   End
   Begin VB.CommandButton CancelButton 
      BackColor       =   &H00FF8080&
      Caption         =   "取消"
      Height          =   375
      Left            =   2040
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1200
      Width           =   615
   End
   Begin VB.CommandButton OKButton 
      BackColor       =   &H00FF8080&
      Caption         =   "确定"
      Height          =   375
      Left            =   360
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackColor       =   &H00FF8080&
      Caption         =   "区"
      Height          =   180
      Left            =   360
      TabIndex        =   12
      Top             =   780
      Width           =   180
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H00FF8080&
      Caption         =   "市"
      Height          =   180
      Left            =   360
      TabIndex        =   11
      Top             =   255
      Width           =   300
   End
End
Attribute VB_Name = "dlg28"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub CancelButton_Click()
        Unload Me
End Sub

Private Sub Combo2_Click()
        If Combo2.list(Combo2.ListIndex) <> "" Then
            Command3.Enabled = True
        End If
End Sub
Private Sub Command1_Click()
'调出统计信息
        If List1.ListCount > 2 Then
           info28frm.tjinfo tongji, Combo1.list(Combo1.ListIndex), Combo2.list(Combo2.ListIndex), tjnum
           Me.Visible = False
        ElseIf List1.ListCount = 2 Then
           MsgBox "只有1条记录,请双击打开", vbOKOnly, "信息统计失败"
        Else
           MsgBox "无信息不能进行统计,请先查询", vbOKCancel, "信息统计失败"
        End If
End Sub
Private Sub Command2_Click()
        If Text1.Text <> "" And Combo2.list(Combo2.ListIndex) <> "" Then
            If Option1.Value = True Then
              Dim rdst As New ADODB.Recordset
              tongji = "select * from sbdqkdcb where 区='" & Combo2.list(Combo2.ListIndex) & "'and (序号='" & Text1.Text & "'or 线路名称 ='" & Text1.Text & "')order by 线路名称 asc"
                  rdst.Open tongji, g_conn
                         If rdst.EOF = True Then
                            List1.Clear
                            List1.AddItem "找不到记录"
                         End If
                            List1.Clear
                            tjnum = 0
                  Do While Not rdst.EOF
                     List1.AddItem rdst!序号 & rdst!线路名称
                     tjnum = tjnum + 1
                  rdst.MoveNext
                  Loop
                             List1.AddItem "找到" & tjnum & "条记录"
                  Set rdst = Nothing
            End If
            If Option2.Value = True Then
              tongji = "select * from sbdqkdcb where 区='" & Combo2.list(Combo2.ListIndex) & "'and (序号 like '%%" & Text1.Text & "%%'or 线路名称 like '%%" & Text1.Text & "%%') order by 线路名称 asc"
                  rdst.Open tongji, g_conn
                         If rdst.EOF = True Then
                            List1.Clear
                            List1.AddItem "找不到记录"
                         End If
                           List1.Clear
                           tjnum = 0
                  Do While Not rdst.EOF
                     List1.AddItem rdst!序号 & rdst!线路名称
                     tjnum = tjnum + 1
                  rdst.MoveNext
                  Loop
                  List1.AddItem "找到" & tjnum & "条记录"
                  Set rdst = Nothing
            End If
        End If
        'Frame1.Visible = False
End Sub
Private Sub Command3_Click()
     Frame1.Visible = True
    'Command3.Enabled = False
     Option1.Value = True
End Sub
Private Sub Form_Load()
        Me.Left = 4000
        Me.Top = 3000
        Combo1.ListIndex = 0
        Combo2.Clear
        Dim rdst As New ADODB.Recordset
            rdst.Open "select * from CUNNAME order by 区 desc", g_conn
        Do While Not rdst.EOF
            If Combo2.list(0) <> rdst!区 Then
              Combo2.AddItem rdst!区, 0
            End If
            rdst.MoveNext
        Loop
            Combo2.AddItem "", 0
End Sub
Private Sub List1_Click()
    If List1.ListIndex = List1.ListCount - 1 Then
        MsgBox "无查询结果", vbOKCancel, "数据查询"
    End If
          Dim rdst As New ADODB.Recordset
          rdst.Open tongji, g_conn
          Dim list As Integer
          list = 0
          Do While Not rdst.EOF
               If list = List1.ListIndex Then
                 fid = rdst!序号
                 hzname = rdst!区
                 End If
          rdst.MoveNext
              list = list + 1
          Loop
       info28frm.info fid, hzname
        'Me.Visible = False
End Sub
Private Sub OKButton_Click()
    List1.Clear
       If Combo2.list(Combo2.ListIndex) = "" Then
         tongji = "select * from sbdqkdcb where 市='" & Combo1.list(Combo1.ListIndex) & "'"
        ElseIf Combo2.list(Combo2.ListIndex) <> "" Then
         tongji = "select * from sbdqkdcb where 区='" & Combo2.list(Combo2.ListIndex) & "'"
    End If
    Dim rdst As New ADODB.Recordset
        rdst.Open tongji, g_conn
        tjnum = 0
    Do While Not rdst.EOF
        tjnum = tjnum + 1
        List1.AddItem rdst!序号 & rdst!线路名称
        rdst.MoveNext
    Loop
        List1.AddItem "共查询到" & tjnum & "条记录"
End Sub

⌨️ 快捷键说明

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