📄 mainjz.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Object = "{D07CD9D2-ECE9-493F-86F2-186659945889}#1.0#0"; "Xpbutton.ocx"
Object = "{625E61B9-D59C-4612-89FC-D10614DC5873}#1.0#0"; "CoolBoySkin.ocx"
Begin VB.Form mainjz
BackColor = &H000080FF&
BorderStyle = 0 'None
Caption = "记帐(交款检查)"
ClientHeight = 7965
ClientLeft = 0
ClientTop = 0
ClientWidth = 9330
LinkTopic = "Form1"
ScaleHeight = 7965
ScaleWidth = 9330
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 285
Left = 1470
TabIndex = 3
Top = 900
Visible = 0 'False
Width = 1215
End
Begin 工程1.xpcmdbutton xpcmdbutton2
Height = 270
Left = 7635
TabIndex = 0
Top = 7350
Width = 975
_ExtentX = 1720
_ExtentY = 476
Caption = "退出"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin 工程1.xpcmdbutton xpcmdbutton1
Height = 315
Left = 6375
TabIndex = 1
Top = 7335
Width = 1050
_ExtentX = 1852
_ExtentY = 556
Caption = "确定"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CoolBoySkinForVB6.CoolBoySkin CoolBoySkin1
Height = 1845
Left = 3240
TabIndex = 2
Top = 120
Width = 3405
_ExtentX = 6006
_ExtentY = 3254
Caption = "记帐(交款检查)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "黑体"
Size = 9.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MenuBackColor = 16777215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 360
Left = 6315
Top = 450
Visible = 0 'False
Width = 2325
_ExtentX = 4101
_ExtentY = 635
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSH
Height = 6615
Left = 225
TabIndex = 4
Top = 630
Width = 8850
_ExtentX = 15610
_ExtentY = 11668
_Version = 393216
FixedCols = 0
BackColorFixed = 16777152
BackColorBkg = 12632256
AllowUserResizing= 3
Appearance = 0
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin 工程1.xpcmdbutton xpcmdbutton3
Height = 285
Left = 240
TabIndex = 5
Top = 7350
Width = 1080
_ExtentX = 1905
_ExtentY = 503
Caption = "返回报表"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Attribute VB_Name = "mainjz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rr As Integer
Dim cc As Integer
Private Sub Form_Load()
Me.Top = mme.Top + mme.Height
Me.Left = Screen.Width - Me.Width - 100
Me.Show
Adodc1.ConnectionString = connstr
Adodc1.CommandType = adCmdText
Adodc1.CommandTimeout = 20
loadmsh
End Sub
Public Sub loadmsh()
With MSH
.Clear
.Cols = 12
.Rows = 1
.TextMatrix(0, 0) = "记帐"
.TextMatrix(0, 1) = "记录号"
.TextMatrix(0, 2) = "交款单号"
.TextMatrix(0, 3) = "项目"
.TextMatrix(0, 4) = "收款金额"
.TextMatrix(0, 5) = "付款金额"
.TextMatrix(0, 6) = "小计"
.TextMatrix(0, 7) = "备注"
.TextMatrix(0, 8) = "日期"
.TextMatrix(0, 9) = "交款人"
.TextMatrix(0, 10) = "接班人"
.TextMatrix(0, 11) = "部门"
.ColWidth(0) = 700
.ColWidth(1) = 0
For i = 2 To 11
.ColWidth(i) = 1000
Next
For i = 0 To 11
.ColAlignment(i) = 4
.ColAlignmentFixed(i) = 4
Next
Adodc1.RecordSource = "select * from yye where flags=0 and ltrim(rtrim(dh))>'0' order by dws"
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
.AddItem " " & vbTab & Trim(Adodc1.Recordset.Fields(0)) & vbTab & Trim(Adodc1.Recordset.Fields(1)) & vbTab & Trim(Adodc1.Recordset.Fields(2)) & vbTab & Trim(Adodc1.Recordset.Fields(3)) & vbTab & Trim(Adodc1.Recordset.Fields(4)) & vbTab & Trim(Adodc1.Recordset.Fields(5)) & vbTab & Trim(Adodc1.Recordset.Fields(6)) & vbTab & Trim(Adodc1.Recordset.Fields(7)) & vbTab & Trim(Adodc1.Recordset.Fields(8)) & vbTab & Trim(Adodc1.Recordset.Fields(9)) & vbTab & Trim(Adodc1.Recordset.Fields(10))
Adodc1.Recordset.MoveNext
Loop
For i = 1 To MSH.Rows - 1
.Row = i
.Col = 0
.CellForeColor = vbRed
Next
End With
End Sub
Private Sub MSH_RowColChange()
rr = MSH.Row
cc = MSH.Col
Text1.Visible = False
If rr = 0 Then Exit Sub
If cc = 0 Then
MSH.TextMatrix(rr, 0) = IIf(Trim(MSH.TextMatrix(rr, 0)) = "√", "", "√")
End If
If cc > 6 Or cc < 4 Then Exit Sub
With Text1
.Move MSH.Left + MSH.ColPos(cc), MSH.RowPos(rr) + MSH.Top, MSH.ColWidth(cc) + 10, MSH.RowHeight(rr)
.Text = MSH.TextMatrix(rr, cc)
.Visible = True
.SetFocus
End With
End Sub
Private Sub Text1_Change()
If cc = 4 Or cc = 5 Then
If Not IsNumeric(Text1.Text) Then Text1.Text = ""
End If
MSH.TextMatrix(rr, cc) = Trim(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
vv = Val(MSH.TextMatrix(rr, 4)) - Val(MSH.TextMatrix(rr, 5))
MSH.TextMatrix(rr, 6) = Format(vv, "#0.00")
If cc < MSH.Cols - 1 Then
cc = cc + 1
Else
cc = 1
If rr < MSH.Rows - 1 Then
rr = rr + 1
ElseIf rr + 1 = MSH.Rows Then
MSH.Rows = rr + 2
End If
End If
Text1.Visible = False
End If
MSH.Row = rr
If cc = 6 Then cc = 7
MSH.Col = cc
MSH_RowColChange
End Sub
Private Sub xpcmdbutton1_Click()
If MsgBox("确定保存记帐吗?", vbYesNo + vbQuestion, "保存") = vbNo Then Exit Sub
On Error Resume Next
Dim bbs As Integer
For i = 1 To MSH.Rows - 1
If rs.State Then rs.Close
bbs = IIf(Trim(MSH.TextMatrix(i, 0)) = "√", 1, 0)
If bbs = 1 Then rs.Open "update yye set flags=1 where id=" & Val(MSH.TextMatrix(i, 1)), cn, 3, 3
ext:
Next
DoEvents
loadmsh
End Sub
Private Sub xpcmdbutton2_Click()
Unload Me
End Sub
Private Sub xpcmdbutton3_Click()
frmbb.Show
Unload mainjz
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -