📄 main_ysbb.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form main_ysbb
BorderStyle = 3 'Fixed Dialog
Caption = "登记预收报表"
ClientHeight = 3990
ClientLeft = 45
ClientTop = 555
ClientWidth = 11100
Icon = "main_ysbb.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3990
ScaleWidth = 11100
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "main_ysbb.frx":000C
Height = 2775
Left = 60
OleObjectBlob = "main_ysbb.frx":0020
TabIndex = 13
Top = 705
Width = 10995
End
Begin VB.Frame Frame2
Caption = "Frame2"
Height = 1290
Left = -3900
TabIndex = 7
Top = 900
Visible = 0 'False
Width = 5010
Begin VB.Data Data2
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\mrjd\kfgl.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 1950
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "djys"
Top = 585
Visible = 0 'False
Width = 2175
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\mrjd\kfgl.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1980
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "djys"
Top = 210
Visible = 0 'False
Width = 2055
End
Begin VB.TextBox G1
Height = 270
Left = 195
TabIndex = 9
Top = 600
Width = 1635
End
Begin VB.TextBox G2
Height = 270
Left = 195
TabIndex = 8
Top = 270
Width = 1620
End
End
Begin VB.Frame Frame1
Height = 675
Left = 60
TabIndex = 0
Top = 0
Width = 10995
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "确定"
Height = 345
Left = 8520
Style = 1 'Graphical
TabIndex = 12
Top = 210
Width = 1200
End
Begin VB.TextBox czy
BackColor = &H80000000&
BorderStyle = 0 'None
Height = 240
Left = 795
TabIndex = 10
Top = 255
Width = 1035
End
Begin MSComCtl2.DTPicker DTM1
Height = 315
Left = 4005
TabIndex = 5
Top = 210
Width = 1350
_ExtentX = 2381
_ExtentY = 556
_Version = 393216
Format = 30212098
CurrentDate = .354166666666667
End
Begin MSComCtl2.DTPicker DTP1
Height = 315
Left = 2625
TabIndex = 3
Top = 210
Width = 1335
_ExtentX = 2355
_ExtentY = 556
_Version = 393216
Format = 30212097
CurrentDate = 37143
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 345
Left = 9720
Style = 1 'Graphical
TabIndex = 2
Top = 210
Width = 1200
End
Begin MSComCtl2.DTPicker DTP2
Height = 315
Left = 5685
TabIndex = 4
Top = 210
Width = 1380
_ExtentX = 2434
_ExtentY = 556
_Version = 393216
Format = 30212097
CurrentDate = 37143
End
Begin MSComCtl2.DTPicker DTM2
Height = 315
Left = 7080
TabIndex = 6
Top = 210
Width = 1350
_ExtentX = 2381
_ExtentY = 556
_Version = 393216
Format = 30212098
CurrentDate = .354166666666667
End
Begin VB.Label Label2
Caption = "操作员:"
Height = 255
Left = 75
TabIndex = 11
Top = 255
Width = 765
End
Begin VB.Label Label1
Caption = "日期从: 到"
Height = 285
Left = 1905
TabIndex = 1
Top = 255
Width = 6795
End
End
Begin VB.Label Labyj
BackStyle = 0 'Transparent
Height = 240
Left = 5265
TabIndex = 16
Top = 3660
Width = 2430
End
Begin VB.Label Labys
BackStyle = 0 'Transparent
Height = 240
Left = 1425
TabIndex = 15
Top = 3660
Width = 2430
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "合计应收宿费: 合计预收宿费:"
Height = 270
Left = 120
TabIndex = 14
Top = 3660
Width = 7560
End
End
Attribute VB_Name = "main_ysbb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'自动识别数据库路径
Data1.DatabaseName = App.Path & "\KFGL.MDB"
Data2.DatabaseName = App.Path & "\KFGL.MDB"
End Sub
Private Sub Form_Activate()
czy.Text = main.StatusBar1.Panels(4).Text
DTP1.Value = Date - 1
DTP2.Value = Date
G1.Text = Left(DTP1, 4) & Right(Left(DTP1, 7), 2) & Right(DTP1, 2) & Left(DTM1, 2) & Left(Right(DTM1, 5), 2)
G2.Text = Left(DTP2, 4) & Right(Left(DTP2, 7), 2) & Right(DTP2, 2) & Left(DTM2, 2) & Left(Right(DTM2, 5), 2)
Data1.RecordSource = "select * from djys where djys.BZ >" & Val(G1.Text) & "AND djys.BZ<" & Val(G2.Text) & " order by 凭证号码"
Data1.Refresh
Data2.RecordSource = "select count(*) as ddd,sum(应收宿费)as 应收宿费1 ,sum(预收金额)as 预收汇总 from djys where djys.BZ >" & Val(G1.Text) & "AND djys.BZ<" & Val(G2.Text) & " and djys.标志 like " + Chr(34) + "*" + Chr(34) + ""
Data2.Refresh
If Data2.Recordset.Fields(1) <> "" Then Labys.Caption = Format(Data2.Recordset.Fields(1)) Else Labys.Caption = "0"
If Data2.Recordset.Fields(2) <> "" Then Labyj.Caption = Format(Data2.Recordset.Fields(2)) Else Labyj.Caption = "0"
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True
End Sub
Private Sub Command1_Click()
'统计应收宿费、预收宿费
If DTP1.Value <= DTP2.Value Then
G1.Text = Left(DTP1, 4) & Right(Left(DTP1, 7), 2) & Right(DTP1, 2) & Left(DTM1, 2) & Left(Right(DTM1, 5), 2)
G2.Text = Left(DTP2, 4) & Right(Left(DTP2, 7), 2) & Right(DTP2, 2) & Left(DTM2, 2) & Left(Right(DTM2, 5), 2)
Data1.RecordSource = "select * from djys where djys.BZ >" & Val(G1.Text) & "AND djys.bz< " & Val(G2.Text) & " order by 凭证号码"
Data1.Refresh
Data2.RecordSource = "select count(*) as ddd,sum(应收宿费)as 应收宿费1 ,sum(预收金额)as 预收汇总 from djys where djys.BZ >" & Val(G1.Text) & "AND djys.bz<" & Val(G2.Text)
Data2.Refresh
If Data2.Recordset.Fields(1) <> "" Then Labys.Caption = Format(Data2.Recordset.Fields(1), "0.00") Else Labys.Caption = "0"
If Data2.Recordset.Fields(2) <> "" Then Labyj.Caption = Format(Data2.Recordset.Fields(2), "0.00") Else Labyj.Caption = "0"
Else
MsgBox ("日期不能颠倒")
DTP2.Value = Date
End If
End Sub
Private Sub Command2_Click()
main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -