?? frmrpttotuse.frm
字號(hào):
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form FrmRptTotUse
Caption = "部門領(lǐng)用匯總表設(shè)置"
ClientHeight = 3300
ClientLeft = 60
ClientTop = 345
ClientWidth = 3255
Icon = "FrmRptTotUse.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3300
ScaleWidth = 3255
StartUpPosition = 1 '所有者中心
Begin MSComDlg.CommonDialog ComDlgRpt
Left = 120
Top = 1440
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton CmdRpt
Caption = "退出(&X)"
Height = 375
Index = 3
Left = 1800
TabIndex = 14
Top = 2520
Width = 1155
End
Begin VB.CommandButton CmdRpt
Caption = "生成報(bào)表(&T)"
Enabled = 0 'False
Height = 375
Index = 2
Left = 300
TabIndex = 13
Top = 2520
Width = 1155
End
Begin VB.CommandButton CmdRpt
Caption = "導(dǎo)出報(bào)表(&E)"
Height = 375
Index = 1
Left = 1800
TabIndex = 12
Top = 1920
Width = 1155
End
Begin VB.CommandButton CmdRpt
Caption = "打印設(shè)置(&P)"
Enabled = 0 'False
Height = 375
Index = 0
Left = 300
TabIndex = 11
Top = 1920
Width = 1155
End
Begin VB.Frame Frame1
Caption = "報(bào)表日期"
Height = 675
Index = 2
Left = 60
TabIndex = 4
Top = 720
Width = 3135
Begin VB.TextBox TxtDay
Height = 300
Left = 2040
MaxLength = 2
TabIndex = 10
Top = 240
Width = 315
End
Begin VB.TextBox TxtMonth
Height = 300
Left = 1380
MaxLength = 2
TabIndex = 9
Top = 240
Width = 315
End
Begin VB.TextBox TxtYear
Height = 300
Left = 540
MaxLength = 4
TabIndex = 8
Top = 240
Width = 495
End
Begin VB.Label Label1
Caption = "日"
Height = 195
Index = 2
Left = 2400
TabIndex = 7
Top = 300
Width = 195
End
Begin VB.Label Label1
Caption = "月"
Height = 195
Index = 1
Left = 1800
TabIndex = 6
Top = 300
Width = 195
End
Begin VB.Label Label1
Caption = "年"
Height = 195
Index = 0
Left = 1140
TabIndex = 5
Top = 300
Width = 195
End
End
Begin VB.Frame Frame1
Caption = "報(bào)表類別"
Height = 675
Index = 1
Left = 60
TabIndex = 0
Top = 0
Width = 3135
Begin VB.OptionButton OptRptType
Caption = "年報(bào)"
Height = 195
Index = 2
Left = 2220
TabIndex = 3
Top = 300
Width = 855
End
Begin VB.OptionButton OptRptType
Caption = "月報(bào)"
Height = 195
Index = 1
Left = 1260
TabIndex = 2
Top = 300
Width = 855
End
Begin VB.OptionButton OptRptType
Caption = "日?qǐng)?bào)"
Height = 195
Index = 0
Left = 300
TabIndex = 1
Top = 300
Value = -1 'True
Width = 855
End
End
End
Attribute VB_Name = "FrmRptTotUse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private cmTotUse As ADODB.Command
Private rsRpt As ADODB.Recordset
Private rsDepartment As ADODB.Recordset
Private rsExpTotUse As ADODB.Recordset
Private strRptCap As String
Private strRptDte As String
Private strRptTyp As String
Private Sub CmdRpt_Click(Index As Integer)
Dim strSQL As String
Select Case Index
Case 0
ComDlgRpt.ShowPrinter
Case 1
If TxtDay.Enabled = False Then TxtDay.Text = ""
If TxtMonth.Enabled = False Then TxtMonth.Text = ""
If DateIsTrue(TxtYear.Text, TxtMonth.Text, TxtDay.Text) Then
Call TotUse_Rpt
If Dir(App.Path & "\xls\totuserpt.xls") <> "" Then
Kill App.Path & "\xls\totuserpt.xls"
End If
strSQL = "select * into [Excel 8.0;database=" & App.Path & _
"\xls\totuserpt.xls].detuse from temp_totuse"
rsExpTotUse.Open strSQL, DEjxc.Conjxc, adOpenStatic, adLockOptimistic
'rsExpTotUse.Close
MsgBox "文件輸出到" & App.Path & "\xls\totuserpt.xls", vbInformation, "輸出完畢"
strSQL = "drop table temp_totuse"
cmTotUse.CommandText = strSQL
cmTotUse.Execute
Else
MsgBox "日期錯(cuò)誤或大于系統(tǒng)啟用日期!", vbCritical, "報(bào)表輸出錯(cuò)誤"
End If
Case 2
If TxtDay.Enabled = False Then TxtDay.Text = ""
If TxtMonth.Enabled = False Then TxtMonth.Text = ""
If DateIsTrue(TxtYear.Text, TxtMonth.Text, TxtDay.Text) Then
Call TotUse_Rpt
RptJxc.Show
Else
MsgBox "日期錯(cuò)誤或大于系統(tǒng)啟用日期!", vbCritical, "報(bào)表生成錯(cuò)誤"
End If
Case 3
Unload Me
End Select
End Sub
Private Sub Form_Load()
intNumWindows = OpenWindow(intNumWindows)
Me.Height = 3705
Me.Width = 3375
Call SetFormStu(Me, frmMain)
Set cmTotUse = New ADODB.Command
cmTotUse.ActiveConnection = DEjxc.Conjxc
cmTotUse.CommandType = adCmdText
Set rsRpt = New ADODB.Recordset
Set rsExpTotUse = New ADODB.Recordset
Set rsDepartment = DEjxc.rsComDepartment
rsDepartment.Open
TxtYear.Text = Year(dteSysDate)
TxtMonth.Text = Month(dteSysDate)
TxtDay.Text = Day(dteSysDate)
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -