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

📄 form6.frm

📁 VB编写的汽车训练场管理系统。可做毕业设计参考/
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Top             =   360
      Width           =   2475
   End
   Begin MSComCtl2.DTPicker DTPicker2 
      Height          =   285
      Left            =   8130
      TabIndex        =   20
      Top             =   90
      Width           =   1125
      _ExtentX        =   1984
      _ExtentY        =   503
      _Version        =   393216
      CustomFormat    =   "hh:nn:ss"
      Format          =   81068034
      CurrentDate     =   37260
   End
   Begin MSComCtl2.DTPicker DTPicker3 
      Height          =   285
      Left            =   6240
      TabIndex        =   21
      Top             =   450
      Width           =   1785
      _ExtentX        =   3149
      _ExtentY        =   503
      _Version        =   393216
      CustomFormat    =   "yyyy-mm-dd"
      Format          =   81068032
      CurrentDate     =   37260
   End
   Begin MSComCtl2.DTPicker DTPicker4 
      Height          =   285
      Left            =   8130
      TabIndex        =   22
      Top             =   450
      Width           =   1125
      _ExtentX        =   1984
      _ExtentY        =   503
      _Version        =   393216
      Format          =   81068034
      CurrentDate     =   37260
   End
   Begin VB.Image Image1 
      Height          =   495
      Left            =   9600
      Picture         =   "Form6.frx":1487
      Stretch         =   -1  'True
      Top             =   0
      Width           =   705
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "等待操作...."
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   5370
      TabIndex        =   25
      Top             =   4530
      Width           =   2040
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "终止时间"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   5130
      TabIndex        =   24
      Top             =   480
      Width           =   1020
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "起始时间"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   5130
      TabIndex        =   23
      Top             =   120
      Width           =   1020
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "报名时间"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   6
      Left            =   480
      TabIndex        =   6
      Top             =   3870
      Width           =   1200
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "场地费用"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   5
      Left            =   480
      TabIndex        =   5
      Top             =   3285
      Width           =   1200
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "就读驾校"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   4
      Left            =   480
      TabIndex        =   4
      Top             =   2715
      Width           =   1200
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "证件号码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   3
      Left            =   480
      TabIndex        =   3
      Top             =   2130
      Width           =   1200
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "证件名称"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   2
      Left            =   480
      TabIndex        =   2
      Top             =   1545
      Width           =   1200
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "性    别"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   1
      Left            =   480
      TabIndex        =   1
      Top             =   975
      Width           =   1260
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "姓    名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Index           =   0
      Left            =   480
      TabIndex        =   0
      Top             =   390
      Width           =   1260
   End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change(Index As Integer)
    On Error Resume Next
    Dim RS As New ADODB.Recordset
    If Index = 2 And Check1.Value = 0 Then
        RS.CursorLocation = adUseClient
        RS.Open "select * from jx where jx like '%" & Combo1(2).Text & "%'", Cn, 1, 3
        Combo1(2).Clear
        Do While Not RS.EOF
          Combo1(2).AddItem RS(0)
          RS.MoveNext
        Loop
        RS.Close
        Combo1(2).Text = Combo1(2).List(0)
    End If
End Sub

Private Sub Combo1_KeyPress(Index As Integer, KeyAscii As Integer)
      If KeyAscii = 13 And Index = 0 Then Combo1(1).SetFocus
      If KeyAscii = 13 And Index = 1 Then Text1(1).Text = format(Date, "yyyymmdd") & format(Time, "hhnnss"): Text1(1).SetFocus
      If KeyAscii = 13 And Index = 2 Then Text1(2).SetFocus
      Dim RS As New ADODB.Recordset
    
End Sub

Private Sub Combo1_LostFocus(Index As Integer)
   If Index = 2 Then
        Dim RS As New ADODB.Recordset
        RS.CursorLocation = adUseClient
        RS.Open "select * from jx where jx='" & Combo1(2).Text & "'", Cn, 1, 3
        If RS.EOF Then Cn.Execute "INSERT jx VALUES('" & Combo1(2).Text & "')"
        RS.Close
    End If
End Sub

Private Sub Command1_Click()
    On Error Resume Next
    Dim i As Integer
    If MsgBox("确实提交", 1 + 32, "系统提示") = vbOK Then
      Err.Clear
      Cn.Execute "INSERT xyb VALUES('" & Trim(Text1(0).Text) & "','" & Combo1(0).Text & "','" & Combo1(1).Text & "','" & Trim(Text1(1).Text) & "','" & Combo1(2).Text & "','" & Trim(Text1(2).Text) & "','" & Trim(Text1(3).Text) & "',0,'" & Yh & "')"
      If Err.Number Then
          MsgBox "提交失败,可能有空值或证件号码已存在", 0 + vbCritical, "系统提示"
          Exit Sub
      Else
          MsgBox "提交成功", 0 + vbExclamation, "系统提示"
          For i = 0 To 3
             If i <> 2 Then Text1(i).Text = ""
          Next
          Text1(0).SetFocus
      End If
    End If
End Sub

Private Sub Command2_Click()
   Unload Me
End Sub

Private Sub Command3_Click()
     If Command3.Caption = ">>>" Then
        Command3.Caption = "<<<"
        Me.Width = 10740
        Me.Left = (MDIForm1.Width - Me.Width) / 2
        Me.Top = (MDIForm1.Height - Me.Height) / 2 - 1000
     Else
        Command3.Caption = ">>>"
        Me.Width = 4935
        Me.Left = (MDIForm1.Width - Me.Width) / 2
        Me.Top = (MDIForm1.Height - Me.Height) / 2 - 1000
     End If
End Sub

Private Sub Command4_Click()
   Dim RS As New ADODB.Recordset
   If Check2.Value = 0 Then
        Adodc1.RecordSource = "select xm,ZJHM,JDJX,cdfy,jbr from xyb where jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'"
        Adodc1.Refresh
        RS.CursorLocation = adUseClient
        RS.Open "select sum(cdfy) from xyb where jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'", Cn, 1, 3
        Label4.Caption = "共收费  " & RS(0) & "  元整"
        RS.Close
    Else
        Adodc1.RecordSource = "select xm,ZJHM,JDJX,cdfy,jbr from xyb where xm='" & Trim(Text2.Text) & "' and jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'"
        Adodc1.Refresh
        RS.CursorLocation = adUseClient
        RS.Open "select sum(cdfy) from xyb where xm='" & Trim(Text2.Text) & "' and jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'", Cn, 1, 3
        Label4.Caption = "共收费  " & RS(0) & "  元整"
        RS.Close
    End If
End Sub

Private Sub Command5_Click()
   Dim F As New FileSystemObject
   Dim Xl As Object
   Dim K As New Excel.Application
   Dim RS As New ADODB.Recordset
   Dim i As Integer, j As Integer
   F.CopyFile App.Path & "\file\表格1.xls", App.Path & "\tmp\表格1" & format(Date, "YYYY_MM") & ".xls"
   Set Xl = K.Workbooks.Open(App.Path & "\tmp\表格1" & format(Date, "YYYY_MM") & ".xls")
   RS.CursorLocation = adUseClient
   RS.Open "select xm,zjm,zjhm,cdfy,jdjx from xyb where jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'", Cn, 1, 3
   i = 7
   j = 1
   Do While Not RS.EOF
       For j = 1 To 5
         Xl.Worksheets(1).Cells(i, j).Value = RS(j - 1)
       Next
       i = i + 1
       RS.MoveNext
  Loop
  RS.Close
  RS.Open "select sum(cdfy) from xyb xyb where jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'", Cn, 1, 3
  Xl.Worksheets(1).Cells(i + 1, 1).Value = "合计"
  Xl.Worksheets(1).Cells(i + 1, 4).Value = RS(0)
  RS.Close
  If MsgBox("是否现在打开" & App.Path & "\file\工资" & format(Date, "YYYY_MM") & ".xls", 1 + vbExclamation, "系统提示") = vbOK Then
         Xl.Application.Visible = True
   Else
         Xl.Application.Quit
   End If
End Sub

Private Sub Command6_Click()
   If Command6.Caption = "修改..." Then
       DataGrid1.AllowUpdate = True
       Command6.Caption = "关闭..."
   Else
       DataGrid1.AllowUpdate = False
       Command6.Caption = "修改..."
   End If
End Sub

Private Sub Command7_Click()
   SFBB = " where jbr='" & Yh & "' and bmsj between '" & format(DTPicker1.Value, "yyyy-mm-dd") & " " & format(DTPicker2.Value, "hh:nn:ss") & "' and '" & format(DTPicker3.Value, "yyyy-mm-dd") & " " & format(DTPicker4.Value, "hh:nn:ss") & "'"
   DataReport2.Show
End Sub

Private Sub Form_Load()
    Dim RS As New ADODB.Recordset
    Me.Left = (MDIForm1.Width - Me.Width) / 2
    Me.Top = (MDIForm1.Height - Me.Height) / 2 - 1000
    Me.Show
    Combo1(0).AddItem "男"
    Combo1(0).AddItem "女"
    Combo1(1).AddItem "流水帐号"
    Combo1(1).AddItem "身份证"
    Combo1(1).AddItem "其他证件"
    RS.CursorLocation = adUseClient
    RS.Open "select * from jx", Cn, 1, 3
    Combo1(2).Clear
    Do While Not RS.EOF
      Combo1(2).AddItem RS(0)
      RS.MoveNext
    Loop
    RS.Close
    Adodc1.ConnectionString = Cn.ConnectionString
    DTPicker1.Value = Date
    DTPicker2.Value = Dlsj
    DTPicker3.Value = Date
    DTPicker4.Value = Time
    Command3.ToolTipText = "统计员工:" & Yh & " 的收费"
    
End Sub

Private Sub Label5_Click()

End Sub

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
    If KeyAscii = 13 And Index = 0 Then Combo1(0).SetFocus
    If KeyAscii = 13 And Index = 1 Then Combo1(2).SetFocus
    If KeyAscii = 13 And Index = 2 Then Text1(3).SetFocus: Text1(3).Text = format(Date, "yyyy-mm-dd") & " " & format(Time, "hh:nn:ss")
    If KeyAscii = 13 And Index = 3 Then Command1.SetFocus
End Sub

⌨️ 快捷键说明

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