📄 pgbaozhuangwuprint.frm
字号:
pgkaipiao.Mask.Text = Format(Date, "yyyy年mm月dd日")
SQL = "select max(单据号) from pgdanjuhao where 开票日期='" & Trim(pgkaipiao.Mask.Text) & "' "
' MsgBox sql
Set result = cn.OpenResultset(SQL, rdOpenDynamic, rdConcurRowVer)
If IsNull(result(0)) = True Then
pgkaipiao.Text1.Text = Format(Date, "yyyymmdd") & "0001"
Else
pgkaipiao.Text1.Text = Val(Trim(result(0))) + 1
End If
result.Close
pgkaipiao.Combo1.Text = ""
pgkaipiao.Combo1.Enabled = True
pgkaipiao.Combo2.Text = ""
pgkaipiao.Combo2.Enabled = True
pgkaipiao.Text2.Text = ""
pgkaipiao.Text2.Enabled = True
pgkaipiao.Text3.Text = ""
pgkaipiao.Text3.Enabled = True
pgkaipiao.Text4.Text = ""
pgkaipiao.Text4.Enabled = True
pgkaipiao.Text5.Text = ""
pgkaipiao.Text5.Enabled = True
' pgkaipiao.Combo3.Text = ""
pgkaipiao.Combo3.Enabled = True
' pgkaipiao.Combo4.Text = ""
pgkaipiao.Combo4.Enabled = True
pgkaipiao.Combo5.Text = ""
pgkaipiao.Combo5.Enabled = True
pgkaipiao.Combo6.Text = ""
pgkaipiao.Combo6.Enabled = True
' pgkaipiao.Combo7.Text = ""
pgkaipiao.Combo7.Enabled = True
' pgkaipiao.Combo8.Text = ""
pgkaipiao.Combo8.Enabled = True
cn.Close
en.Close
Unload Me
End Sub
Private Sub MSF_Click()
If MSF.Col > 1 And MSF.Row < MSF.Rows - 1 Then
Text2.Visible = True
Text2.SetFocus
Text2.Text = MSF.Text
Text2.Top = MSF.Top + MSF.CellTop
Text2.Left = MSF.Left + MSF.CellLeft
Text2.Width = MSF.CellWidth
End If
End Sub
Private Sub Option1_Click()
Text1.Text = ""
If record(2) = "" And record(3) = "" Then
MsgBox "票据已经打印过"
Exit Sub
End If
MSF.Rows = 2
For i = 0 To MSF.Rows - 1
MSF.RowHeight(i) = 400
If i = 1 Then
MSF.TextArray(i * MSF.Cols) = ""
MSF.TextArray(i * MSF.Cols + 1) = ""
MSF.TextArray(i * MSF.Cols + 2) = ""
MSF.TextArray(i * MSF.Cols + 3) = ""
MSF.TextArray(i * MSF.Cols + 4) = ""
MSF.TextArray(i * MSF.Cols + 5) = ""
End If
Next i
''''''''''填写数据
If t = False Then
MSF.TextArray(1 * MSF.Cols) = record(2)
Else
MSF.TextArray(1 * MSF.Cols) = record(2) + 1
End If
MSF.TextArray(1 * MSF.Cols + 1) = record(10)
MSF.TextArray(1 * MSF.Cols + 2) = record(5)
MSF.TextArray(1 * MSF.Cols + 3) = record(6)
MSF.TextArray(1 * MSF.Cols + 4) = record(7)
MSF.TextArray(1 * MSF.Cols + 5) = record(8)
End Sub
Private Sub Option2_Click()
If record(2) = "" And record(3) = "" Then
MsgBox "票据已经打印过"
Exit Sub
End If
MSF.Rows = 2
Text1.Text = ""
For i = 0 To MSF.Rows - 1
MSF.RowHeight(i) = 400
If i = 1 Then
MSF.TextArray(i * MSF.Cols) = ""
MSF.TextArray(i * MSF.Cols + 1) = ""
MSF.TextArray(i * MSF.Cols + 2) = ""
MSF.TextArray(i * MSF.Cols + 3) = ""
MSF.TextArray(i * MSF.Cols + 4) = ""
MSF.TextArray(i * MSF.Cols + 5) = ""
End If
Next i
End Sub
Private Sub Text1_Change()
Text2.Visible = False
If record(2) = "" And record(3) = "" Then
MsgBox "票据已经打印过"
Exit Sub
End If
MSF.Rows = 2
If Option2.Value = True Then
If Text1.Text <> "" Then
MSF.Rows = MSF.Rows + Text1.Text - 1
End If
For i = 0 To MSF.Rows - 1
MSF.RowHeight(i) = 400
If i = 1 Then
MSF.TextArray(i * MSF.Cols) = ""
MSF.TextArray(i * MSF.Cols + 1) = ""
MSF.TextArray(i * MSF.Cols + 2) = ""
MSF.TextArray(i * MSF.Cols + 3) = ""
MSF.TextArray(i * MSF.Cols + 4) = ""
MSF.TextArray(i * MSF.Cols + 5) = ""
End If
Next i
Else
If Option1.Value = False Then
MsgBox "先选择分票打印,在输入分票张数"
Text1.Text = ""
Exit Sub
End If
End If
''''''''''''填写数据
For i = 1 To MSF.Rows - 1
MSF.TextArray(i * MSF.Cols) = Val(record(2)) + i
MSF.TextArray(i * MSF.Cols + 1) = record(10)
Next i
End Sub
Private Sub Text2_Change()
MSF.Text = Text2.Text
Dim s1, s2, s3, s4 As Double
s1 = Val(record(5))
s2 = Val(record(6))
s3 = Val(record(7))
s4 = Val(record(8))
For i = 1 To MSF.Rows - 2
If s1 - Val(Trim(MSF.TextArray(i * MSF.Cols + 2))) > 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 2) = s1 - Val(Trim(MSF.TextArray(i * MSF.Cols + 2)))
s1 = s1 - Val(Trim(MSF.TextArray(i * MSF.Cols + 2)))
ElseIf s1 - Val(Trim(MSF.TextArray(i * MSF.Cols + 2))) = 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 2) = ""
s1 = s1 - Val(Trim(MSF.TextArray(i * MSF.Cols + 2)))
Else
Call cs
Exit For
End If
If s2 - Val(Trim(MSF.TextArray(i * MSF.Cols + 3))) > 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 3) = s2 - Val(Trim(MSF.TextArray(i * MSF.Cols + 3)))
s2 = s2 - Val(Trim(MSF.TextArray(i * MSF.Cols + 3)))
ElseIf s2 - Val(Trim(MSF.TextArray(i * MSF.Cols + 3))) = 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 3) = ""
s2 = s2 - Val(Trim(MSF.TextArray(i * MSF.Cols + 3)))
Else
Call cs
Exit For
End If
If s3 - Val(Trim(MSF.TextArray(i * MSF.Cols + 4))) > 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 4) = s3 - Val(Trim(MSF.TextArray(i * MSF.Cols + 4)))
s3 = s3 - Val(Trim(MSF.TextArray(i * MSF.Cols + 4)))
ElseIf s3 - Val(Trim(MSF.TextArray(i * MSF.Cols + 4))) = 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 4) = ""
s3 = s3 - Val(Trim(MSF.TextArray(i * MSF.Cols + 4)))
Else
Call cs
Exit For
End If
If s4 - Val(Trim(MSF.TextArray(i * MSF.Cols + 5))) > 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 5) = s4 - Val(Trim(MSF.TextArray(i * MSF.Cols + 5)))
s4 = s4 - Val(Trim(MSF.TextArray(i * MSF.Cols + 5)))
ElseIf s4 - Val(Trim(MSF.TextArray(i * MSF.Cols + 5))) = 0 Then
MSF.TextArray((MSF.Rows - 1) * MSF.Cols + 5) = ""
s4 = s4 - Val(Trim(MSF.TextArray(i * MSF.Cols + 5)))
Else
Call cs
Exit For
End If
If s1 < 0 Or s2 < 0 Or s3 < 0 Or s4 < 0 Then
MsgBox "提示?输入出错,核对后重新输入"
Text2.Text = ""
Text2.Visible = False
For j = 1 To MSF.Rows - 1
' MSF.TextArray(i * MSF.Cols) = ""
' MSF.TextArray(i * MSF.Cols + 1) = ""
MSF.TextArray(j * MSF.Cols + 2) = ""
MSF.TextArray(j * MSF.Cols + 3) = ""
MSF.TextArray(j * MSF.Cols + 4) = ""
MSF.TextArray(j * MSF.Cols + 5) = ""
Next j
Exit For
End If
Next i
End Sub
Sub cs()
MsgBox "提示?输入出错,核对后重新输入"
Text2.Text = ""
Text2.Visible = False
For j = 1 To MSF.Rows - 1
' MSF.TextArray(i * MSF.Cols) = ""
' MSF.TextArray(i * MSF.Cols + 1) = ""
MSF.TextArray(j * MSF.Cols + 2) = ""
MSF.TextArray(j * MSF.Cols + 3) = ""
MSF.TextArray(j * MSF.Cols + 4) = ""
MSF.TextArray(j * MSF.Cols + 5) = ""
Next j
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -