📄 editpd.frm
字号:
Width = 2295
_ExtentX = 4048
_ExtentY = 529
Alignment = 1
BackColor = -2147483644
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Locked = -1 'True
End
Begin TextEx.VbTextEx hqsum
Height = 300
Left = 5280
TabIndex = 51
Top = 3840
Width = 2295
_ExtentX = 4048
_ExtentY = 529
Alignment = 1
BackColor = -2147483644
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Locked = -1 'True
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSG2
Height = 1095
Left = 120
TabIndex = 61
Top = 4800
Width = 7935
_ExtentX = 13996
_ExtentY = 1931
_Version = 393216
AllowUserResizing= 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin TextEx.VbTextEx Pssum
Height = 300
Left = 1440
TabIndex = 62
Top = 6000
Width = 2295
_ExtentX = 4048
_ExtentY = 529
Alignment = 1
BackColor = -2147483644
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Locked = -1 'True
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "数量(合计):"
Height = 180
Left = 240
TabIndex = 49
Top = 3900
Width = 1260
End
Begin VB.Label Label27
AutoSize = -1 'True
Caption = "单据编号:"
Height = 180
Left = 6120
TabIndex = 30
Top = 120
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "品种名称"
Height = 180
Left = 360
TabIndex = 29
Top = 1920
Width = 720
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "规格"
Height = 180
Left = 1560
TabIndex = 28
Top = 1920
Width = 360
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "数量(件)"
Height = 180
Left = 2160
TabIndex = 27
Top = 1920
Width = 720
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "票据号码"
Height = 180
Left = 3840
TabIndex = 26
Top = 1920
Width = 720
End
Begin VB.Label Label16
AutoSize = -1 'True
Caption = "金额"
Height = 180
Left = 4920
TabIndex = 25
Top = 1920
Width = 360
End
Begin VB.Label Label17
AutoSize = -1 'True
Caption = "开票日期"
Height = 180
Left = 5880
TabIndex = 24
Top = 1920
Width = 720
End
Begin VB.Label Label18
AutoSize = -1 'True
Caption = "备注"
Height = 180
Left = 7080
TabIndex = 23
Top = 1920
Width = 360
End
Begin VB.Label Label19
AutoSize = -1 'True
Caption = "品种名称"
Height = 180
Left = 360
TabIndex = 22
Top = 4200
Width = 720
End
Begin VB.Label Label20
AutoSize = -1 'True
Caption = "规格"
Height = 180
Left = 1560
TabIndex = 21
Top = 4200
Width = 360
End
Begin VB.Label Label21
AutoSize = -1 'True
Caption = "数量"
Height = 180
Left = 2520
TabIndex = 20
Top = 4200
Width = 360
End
Begin VB.Label Label23
AutoSize = -1 'True
Caption = "票据号码"
Height = 180
Left = 3480
TabIndex = 19
Top = 4200
Width = 720
End
Begin VB.Label Label24
AutoSize = -1 'True
Caption = "开票日期"
Height = 180
Left = 4800
TabIndex = 18
Top = 4200
Width = 720
End
Begin VB.Label Label25
AutoSize = -1 'True
Caption = "备注"
Height = 180
Left = 6120
TabIndex = 17
Top = 4200
Width = 360
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "数量(瓶)"
Height = 180
Left = 3000
TabIndex = 16
Top = 1920
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "金额(合计):"
Height = 180
Left = 3960
TabIndex = 15
Top = 3900
Width = 1260
End
Begin VB.Label Label22
AutoSize = -1 'True
Caption = "委托司机办理:"
Height = 180
Left = 3960
TabIndex = 14
Top = 6045
Width = 1260
End
Begin VB.Label Label26
AutoSize = -1 'True
Caption = "交付司机奖卡:"
Height = 180
Left = 120
TabIndex = 13
Top = 6525
Width = 1260
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "数量(合计):"
Height = 180
Left = 120
TabIndex = 12
Top = 6045
Width = 1260
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "单据编号:"
Height = 180
Left = 6240
TabIndex = 1
Top = 480
Width = 900
End
Begin VB.Label pdcode
AutoSize = -1 'True
Caption = "096363333"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 225
Left = 7080
TabIndex = 0
Top = 120
Width = 945
End
End
Attribute VB_Name = "EditPd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Conn As New ADODB.Connection
Private Rs As New ADODB.Recordset
Private Selrow As Integer
Private SelrowP As Integer
Private oRs As New ADODB.Recordset
Private Sub Command1_Click()
On Error Resume Next
s = 2
If MSG1.TextMatrix(1, 1) = "" Then
s = 2
Else
MSG1.Rows = MSG1.Rows + 1
s = MSG1.Rows
End If
For i = 0 To MSG1.Cols - 2
If i = 5 Then
MSG1.TextMatrix(s - 1, i + 1) = FormatNumber(h1(i).Text)
Else
MSG1.TextMatrix(s - 1, i + 1) = h1(i).Text
End If
h1(i).Text = ""
Next
hssum.Text = CStr(Sjsum()) + "件(" + CStr(Ssum()) + "瓶)"
hqsum.Text = FormatNumber(Gsum())
If s > 6 Then
MsgBox "总行数不能超过6行!", 0 + 48 + 0
p1(0).SetFocus
Exit Sub
End If
h1(0).SetFocus
End Sub
Function Gsum() As Long
For i = 1 To MSG1.Rows - 1
If IsNumeric(MSG1.TextMatrix(i, 6)) = False Then
Gsum = Gsum + 0
Else
Gsum = Gsum + CLng(MSG1.TextMatrix(i, 6))
End If
Next
End Function
Function Ssum() As Long
For i = 1 To MSG1.Rows - 1
If IsNumeric(MSG1.TextMatrix(i, 4)) = False Then
Ssum = Ssum + 0
Else
Ssum = Ssum + CLng(MSG1.TextMatrix(i, 4))
End If
Next
End Function
Function Sjsum() As Long
For i = 1 To MSG1.Rows - 1
If IsNumeric(MSG1.TextMatrix(i, 3)) = False Then
Sjsum = Sjsum + 0
Else
Sjsum = Sjsum + CLng(MSG1.TextMatrix(i, 3))
End If
Next
End Function
Function Psum() As Long
For i = 1 To MSG2.Rows - 1
If IsNumeric(MSG2.TextMatrix(i, 3)) = False Then
Psum = Psum + 0
Else
Psum = Psum + CLng(MSG2.TextMatrix(i, 3))
End If
Next
End Function
Private Sub Command2_Click()
If MSG1.Rows > 2 Then
MSG1.RemoveItem (MSG1.RowSel)
Else
For s = 1 To MSG1.Cols - 1
MSG1.TextMatrix(1, s) = ""
Next
End If
hssum.Text = FormatNumber(Ssum())
hqsum.Text = FormatNumber(Gsum())
Selrow = 0
End Sub
Private Sub Command3_Click()
If Selrow = 0 Then Exit Sub
s = Selrow
For i = 0 To MSG1.Cols - 2
If i = 5 Then
If IsNumeric(h1(i).Text) Then MSG1.TextMatrix(s, i + 1) = FormatNumber(h1(i).Text)
Else
MSG1.TextMatrix(s, i + 1) = h1(i).Text
End If
'h1(i).Text = ""
Next
hssum.Text = CStr(Sjsum()) + "件(" + CStr(Ssum()) + "瓶)"
hqsum.Text = FormatNumber(Gsum())
End Sub
Private Sub Command4_Click()
If SelrowP = 0 Then Exit Sub
s = SelrowP
For i = 0 To MSG2.Cols - 2
MSG2.TextMatrix(s, i + 1) = p1(i).Text
'h1(i).Text = ""
Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -