📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Option Explicit
Public txtstring As String '删除记录的 "编号"
Public filterstring As String '筛选条件
Public lstring As String '显示查询条件
Public tnumber As String '向新增用户窗口传递编号
Public staff As String '操作员
Public first As Integer
'按月,按日查询标题变量
Public sx As Integer
Public sy As Integer
Public dyear As String
Public dmonth As String
Public dday As String
Public qhj As Long
Public chen As Long
Public nong As Long
Public shou As Long
Public chu As Long
'欠费查询变量
Public numchen As Integer
Public numnong As Integer
Public chengsh As Long
Public nongsh As Long
Public duechart(1 To 3, 1 To 2) As Variant
Public Sub history(czy As String, jrsj As Date, xm As String, lksj As Date)
If hzzde.rshistorydocument.State <> adStateOpen Then
hzzde.rshistorydocument.Open
End If
If hzzde.rshistorydocument.RecordCount < 200 Then
hzzde.rshistorydocument.AddNew
hzzde.rshistorydocument.Fields(0).Value = czy
hzzde.rshistorydocument.Fields(1).Value = jrsj
hzzde.rshistorydocument.Fields(2).Value = xm
hzzde.rshistorydocument.Fields(3).Value = lksj
hzzde.rshistorydocument.Fields(4).Value = Format(jrsj, "yyyy-mm-dd")
hzzde.rshistorydocument.Update
Else
hzzde.rshistorydocument.MoveFirst
hzzde.rshistorydocument.Delete adAffectCurrent
hzzde.rshistorydocument.Update
hzzde.rshistorydocument.AddNew
hzzde.rshistorydocument.Fields(0).Value = czy
hzzde.rshistorydocument.Fields(1).Value = jrsj
hzzde.rshistorydocument.Fields(2).Value = xm
hzzde.rshistorydocument.Fields(3).Value = lksj
hzzde.rshistorydocument.Fields(4).Value = Format(jrsj, "yyyy-mm-dd")
hzzde.rshistorydocument.Update
End If
hzzde.rshistorydocument.Close
End Sub
Public Sub duetotal()
numchen = 0
numnong = 0
chengsh = 0
nongsh = 0
hzzde.rsdue.MoveFirst
Do While Not hzzde.rsdue.EOF
If hzzde.rsdue.Fields(2).Value = "城市户" Then
numchen = numchen + 1
chengsh = chengsh + hzzde.rsdue.Fields(6).Value
End If
If hzzde.rsdue.Fields(2).Value = "农村户" Then
numnong = numnong + 1
nongsh = nongsh + hzzde.rsdue.Fields(6).Value
End If
hzzde.rsdue.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -