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

📄 form10.frm

📁 办公室小车管理系统,能自动打印派车单,自动统计小车的出车里程耗油等.
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Left            =   1440
      TabIndex        =   8
      Top             =   3600
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "领用人:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Index           =   4
      Left            =   1440
      TabIndex        =   6
      Top             =   3195
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "数量:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Index           =   3
      Left            =   1440
      TabIndex        =   4
      Top             =   2790
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "单位:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Index           =   2
      Left            =   1440
      TabIndex        =   2
      Top             =   2400
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "领用物品:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Index           =   1
      Left            =   1440
      TabIndex        =   1
      Top             =   1965
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "领用部室:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Index           =   0
      Left            =   1440
      TabIndex        =   0
      Top             =   1560
      Width           =   1815
   End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim bgrp(6, 2000)
Dim i, j, r



Private Sub cmdDelete_Click()
datPrimaryRS.Recordset.Delete
End Sub

Private Sub cmdRefresh_Click()
If DBCombo1.Text <> "" Then
  datPrimaryRS.RecordSource = "select * from bgrp where bmm='" & DBCombo1.Text & "' and lrsj='" & Format(DTPicker1.Value, "yyyy-mm-dd") & "'"
  datPrimaryRS.Refresh
  Command2.Enabled = True
  
   Else
     datPrimaryRS.Refresh
     End If
End Sub

Private Sub cmdUpdate_Click()
On Error GoTo AddErr
  datPrimaryRS.Recordset.Update

  Exit Sub
AddErr:
  MsgBox Err.Description
'bgrp(1, r) = DBCombo1.Text
'bgrp(2, r) = DBCombo2.Text
'For i = 1 To 4
'bgrp(i + 2, r) = txtFields(i).Text
'Next

End Sub

Private Sub Command1_Click()

On Error GoTo AddErr
  datPrimaryRS.Recordset.AddNew

  Exit Sub
AddErr:
  MsgBox Err.Description
'bgrp(1, j) = DBCombo1.Text
'bgrp(2, j) = DBCombo2.Text
'For i = 1 To 4
'bgrp(i + 2, j) = txtFields(i).Text
'Next
 'DBCombo1.Text = ""
 'DBCombo2.Text = ""
'For i = 2 To 4
 'txtFields(i).Text = ""
'Next
'r = j
'j = j + 1


End Sub

Private Sub Command2_Click()
Dim pags, cos1, ros1, lcc As Integer
'Dim X As printer
' sj = "2002-01-13"
Adodc1.Recordset.MoveFirst
 pags = MsgBox("现在开始打印", 36)
If pags = 6 Then
m = 1
Printer.Orientation = 1
Printer.Font.Name = "隶书"
Printer.Print
Printer.Print qym; "办公室统计"
Printer.FontSize = 18
'printer.FontName = "隶书"

Printer.Print
Printer.Print
Printer.Print Tab(21); DBCombo1.Text; "办公用品领用单"
ros1 = datPrimaryRS.Recordset.RecordCount
cos1 = datPrimaryRS.Recordset.Fields.Count


Printer.Font.Size = 12
Printer.Font.Underline = True
Printer.Print
Printer.Print Tab(9); datPrimaryRS.Recordset.Fields(0); Tab(59); Format(DTPicker1.Value, "yyyy年mm月dd日") & "至" & Format(DTPicker2.Value, "yyyy年mm月dd日"); Tab(65); "第"; m; "页";
Printer.Print
Printer.Font.Size = 12
Printer.Print Tab(2); String(100, "━")
Dim sde(7) As String
sde(1) = "领用物品:"
sde(2) = "单位"
sde(3) = "数量"
Printer.Font.Underline = False

For j = 0 To 6
     'If Form6.DataGrid1.Text = "" Then GoTo 20
     Printer.Print Tab(j * 11 + 9); sde(j + 1);
   Next j
Printer.Print Tab(2); String(100, "━")

n = 0
For i = 0 To ros1 - 1 Step 1

 n = n + 1
 For j = 0 To cos1 - 1 Step 1
   ' DataGrid1.Row = i
   ' DataGrid1.Col = j
   ' If Form6.dataGrid1.Text = "" Then GoTo 20
     Printer.Print Tab(j * 11 + 9); datPrimaryRS.Recordset.Fields(j);
   
   Next j
 datPrimaryRS.Recordset.MoveNext
   'Print #1, ""
   If n >= 40 Then
   Printer.Font.Underline = True
m = m + 1

   Printer.Print Tab(2); String(140, "━")

    Printer.Print
  Printer.Print Tab(55); "****制表时间" & Format(Now, "yyyy年mm月dd日hh时mm分") & "****"
   MsgBox "一页没打完,请添加一页新纸"
  
  Printer.NewPage
  Printer.Font.Name = "隶书"
Printer.Print
Printer.Print qym & "办公室统计"
Printer.Font.Size = 18
Printer.Print
Printer.Font.Underline = True

Printer.Print Tab(21); DBCombo1.Text; "办公用品领用单"
Printer.Print
'ros1 = Adodc1.Recordset.RecordCount
'cos1 = Adodc1.Recordset.Fields.Count
Printer.Font.Size = 12
Printer.Print Tab(9); Format(DTPicker1.Value, "yyyy年mm月dd日") & "至" & Format(DTPicker2.Value, "yyyy年mm月dd日"); Tab(65); "第"; m; "页";

n = 0
   Printer.Print Tab(2); String(140, "━")
'Dim sde(6) As String
sde(1) = "领用物品:"
sde(2) = "单位"
sde(3) = "数量"
For j = 0 To 6
     'If Form6.DataGrid1.Text = "" Then GoTo 20
     Printer.Print Tab(j * 11 + 9); sde(j + 1);
   Next j
Printer.Print Tab(2); String(100, "━")

n = 0
Printer.Font.Underline = True
End If
20   Printer.Print
  Next i
  Printer.Font.Underline = True

  Printer.Print Tab(2); String(140, "━")
   Printer.Print
    Printer.Print
Printer.Print Tab(10);
  Printer.Print
  Printer.Print Tab(30); "****制表时间" & Format(Now, "yyyy年mm月dd日hh时mm分") & "****"
  'printer.Print Tab(30); "第"; m; "页"
bsk.Show
 Printer.EndDoc
  Printer.Orientation = 1
End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
Next

End Sub

Private Sub Command5_Click()
End Sub

Private Sub Command6_Click()
End Sub

Private Sub Command7_Click()
 End Sub

Private Sub Command8_Click()

For i = 1 To j
datPrimaryRS.Recordset.AddNew
datPrimaryRS.Recordset.Fields(0) = bgrp(1, j)
datPrimaryRS.Recordset.Fields(1) = bgrp(2, j)
datPrimaryRS.Recordset.Fields(2) = bgrp(3, j)
datPrimaryRS.Recordset.Fields(3) = bgrp(4, j)
datPrimaryRS.Recordset.Fields(4) = bgrp(5, j)
datPrimaryRS.Recordset.Fields(5) = bgrp(6, j)
datPrimaryRS.Recordset.Update
Next i

End Sub

Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
'Txt1.Text = Format(DTPicker1.Value, "yyyy-mm-dd")
End Sub

Private Sub DTPicker1_Click()
Text1.Text = Format(DTPicker1.Value, "yyyy-mm-dd")

End Sub

Private Sub Form_Load()
  datPrimaryRS.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\BG.MDB;Persist Security Info=False"
  datPrimaryRS.Refresh
Data1.DatabaseName = App.Path & "\bg.mdb"
Data2.DatabaseName = App.Path & "\bg.mdb"
Data1.Refresh
Data2.Refresh
DTPicker1.Value = Now
Text1.Text = Format(Now, "yyyy-mm-dd")
End Sub

Private Sub Command0_Click()
 On Error GoTo AddErr
  datPrimaryRS.Recordset.AddNew

  Exit Sub
AddErr:
  MsgBox Err.Description
End Sub

Private Sub Text1_Change()
On Error Resume Next
 DTPicker1.Value = Text1.Text
End Sub

Private Sub txtFields_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
' txtFields(1).ToolTipText = Format(Now, "yyyy-mm-dd")
End Sub

⌨️ 快捷键说明

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