📄 yj1_form_list.frm
字号:
drug_kind.AddItem "中成药"
drug_kind.AddItem "材 料"
drug_kind.Text = "西 药"
Form3.Enabled = False
Form3.Visible = False
print_COM.Enabled = False
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form3.Enabled = True
Form3.Visible = True
End Sub
Private Sub print_com_Click()
Dim s As Integer
Dim j As Integer
Dim mnumber
Dim mline
Dim mpage
mline = 20
Dim mlast
Dim xh As Integer
biao.Refresh
If biao.Resultset.EOF And biao.Resultset.BOF Then
MsgBox "没有数据", , "错误"
print_COM.Enabled = False
Exit Sub
End If
If biao.Resultset.RowCount = 1 Then
MsgBox "没有数据", , "错误"
print_COM.Enabled = False
Exit Sub
End If
If report_id = "0" Then
mnumber = biao.Resultset.RowCount
mpage = mnumber \ mline
mlast = mnumber Mod mline
If mlast <> 0 Then mpage = mpage + 1
biao.Resultset.MoveFirst
Screen.MousePointer = 11
'打印
Printer.PaperSize = 39
xh = 0
Do
Do
mpy = InputBox("本次打印共计" + CStr(mpage) + "页,请输入打印起始页码:", "输入")
If mpy Like "*'*" = False Then Exit Do
Loop
If Trim(mpy) = "" Or Val(mpy) <= mpage Then Exit Do
Loop
If Trim(mpy) = "" Then
Screen.MousePointer = vbDefault
Exit Sub
Else
p_begin = Val(mpy)
End If
For s = 1 To ((p_begin - 1) * mline)
biao.Resultset.MoveNext
Next
For s = p_begin To mpage
Printer.FontSize = 20
Printer.Print Space(39) + yuanming
Printer.FontSize = 15
Printer.FontName = "隶书"
Printer.Print Space(44) + "门 诊 药 房 药 品 盘 点、 销 售 统 计 表 "
Printer.Print ""
Printer.FontSize = 9.5
Printer.Print " 类型:" + CStr(Combo2.Text) + Space(5) + MEX + Space(38) + CStr(m1) + "--" + CStr(M2) + Space(55) + "第" + CStr(s) + "页/共" + CStr(mpage) + "页"
Printer.FontName = "宋体"
Printer.Print "┌──┬───┬──────────┬───────┬──┬─────┬───────┬───────┬───────┬───────┬───────────────┬───────┬───────┐"
Printer.Print "│ 序 │ │ │ │ │ 零 售 价 │ 上月结存 │ 本月请领 │ 本月调价 │ 本月退库 │ 本 月 销 售 │ 本月销售其他 │ 月末盘点结存 │"
Printer.Print "│ │代 码│ 药 品 名 称 │ 规 格 │单位├─────┼───────┼───────┼───────┼───────┼───────┬───────┼───────┼───────┤"
Printer.Print "│ 号 │ │ │ │ │ 批 发 价 │ 批发总金额 │ 批发总金额 │ 批发总金额 │ 批发总金额 │ 批发总金额 │ 零售总金额 │ 批发总金额 │ 批发总金额 │"
For j = 1 To mline
If Not biao.Resultset.EOF Then
If Trim(biao.Resultset!代码) <> "合计" Then
xh = xh + 1
Printer.Print "├──┼───┼──────────┼───────┼──┼─────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤"
Printer.Print "│" + Space(4) _
; "│" + Space(6) _
; "│" + Space(20) _
; "│" + Space(14) _
; "│" + Space(4) _
; "│" + iszero(biao.Resultset!单价) _
; "│" + iszero1(biao.Resultset!上月结存数量) _
; "│" + iszero1(biao.Resultset!本月请领数量) _
; "│" + iszero1(biao.Resultset!本月调价数量) _
; "│" + iszero1(biao.Resultset!本月退库数量) _
; "│" + iszero1(biao.Resultset!本月销售数量) _
; "│" + Space(14) _
; "│" + iszero1(biao.Resultset!本月销售其他数量) _
; "│" + iszero1(biao.Resultset!月末盘点结存数量) _
; "│"
Printer.Print "│" + Space(4 - DxLen(CStr(xh))) + CStr(xh) _
; "│" + CStr(biao.Resultset!代码) _
; "│" + CStr(biao.Resultset!药品名称) _
; "│" + CStr(biao.Resultset!规格) _
; "│" + CStr(biao.Resultset!单位) _
; "│" + iszero(biao.Resultset!批发单价) _
; "│" + iszero(biao.Resultset!上月结存批发总金额) _
; "│" + iszero(biao.Resultset!本月请领批发总金额) _
; "│" + iszero(biao.Resultset!本月调价批发金额差) _
; "│" + iszero(biao.Resultset!本月退库批发总金额) _
; "│" + iszero(biao.Resultset!本月销售批发总金额) _
; "│" + iszero(biao.Resultset!本月销售零售总金额) _
; "│" + iszero(biao.Resultset!本月销售其他批发总金额) _
; "│" + iszero(biao.Resultset!月末盘点结存批发总金额) _
; "│"
Else
Printer.Print "├──┴───┴──────────┴───────┴──┼─────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤"
Printer.Print "│ 合 计 │ │" _
+ iszero(biao.Resultset!上月结存批发总金额) _
; "│" + iszero(biao.Resultset!本月请领批发总金额) _
; "│" + iszero(biao.Resultset!本月调价批发金额差) _
; "│" + iszero(biao.Resultset!本月退库批发总金额) _
; "│" + iszero(biao.Resultset!本月销售批发总金额) _
; "│" + iszero(biao.Resultset!本月销售零售总金额) _
; "│" + iszero(biao.Resultset!本月销售其他批发总金额) _
; "│" + iszero(biao.Resultset!月末盘点结存批发总金额) _
; "│"
End If
biao.Resultset.MoveNext
End If
Next j
If biao.Resultset.EOF Then
Printer.Print "└────────────────────────────┴─────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘"
Printer.Print "药剂科负责人: 报表人:" + mop_name + " 药品会计: 调剂员: 打印日期:" + CStr(Date) + " 打印时间:" + CStr(Time)
Exit For
Else
Printer.Print "└──┴───┴──────────┴───────┴──┴─────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘"
Printer.Print "药剂科负责人: 报表人:" + mop_name + " 药品会计: 调剂员: 打印日期:" + CStr(Date) + " 打印时间:" + CStr(Time)
Printer.NewPage
End If
Next s
Printer.EndDoc
Screen.MousePointer = 0
MsgBox "打印结束", , "确定"
End If
If report_id = "2" Then
biao.Resultset.MoveLast
mnumber = biao.Resultset.RowCount
biao.Resultset.MoveFirst
mline = 25
mpage = mnumber \ mline
mlast = mnumber Mod mline
If mlast <> 0 Then
mpage = mpage + 1
End If
'设置纸张型号,高度,宽度
Printer.PaperSize = 39
' Printer.Height = 8000
' Printer.Width = 24000
'分页打印
Do
Do
mpy = InputBox("本次打印共计" + CStr(mpage) + "页,请输入打印起始页码:", "输入")
If mpy Like "*'*" = False Then Exit Do
Loop
If Trim(mpy) = "" Or Val(mpy) <= mpage Then Exit Do
Loop
If Trim(mpy) = "" Then
Screen.MousePointer = vbDefault
Exit Sub
Else
p_begin = Val(mpy)
End If
For s = 1 To ((p_begin - 1) * mline)
biao.Resultset.MoveNext
Next
For i = p_begin To mpage
'打印名头
Printer.FontName = "隶书"
Printer.FontSize = 18
Printer.Print " " + yuanming
Printer.FontSize = 5
Printer.Print " "
Printer.FontSize = 15
Printer.Print " 门诊药局 (药品,卫生材料) 销售统计表 "
Printer.Print " "
Printer.FontName = "宋体"
Printer.FontSize = 10.5
Printer.Print "打印日期: " + CStr(Date) + Space(3) + CStr(Time) + Space(50) + "页数: " + RTrim(CStr(i)) + "/" + RTrim(CStr(mpage))
Printer.Print "┌───┬──────────┬───────┬──┬─────┬──────┬──────┬──────┬───────┬───────┬───────┐"
Printer.Print "│代 码│ 药 品 名 称 │ 规 格 │单位│ 零售单价 │ 门诊数量 │ 住院数量 │ 数量合计 │门诊零售额合计│住院零售额合计│ 零售金额合计 │"
'打印记录
For j = 1 To mline
If Not biao.Resultset.EOF Then
If Trim(biao.Resultset!代码) <> "Z99999" Then
Printer.Print "├───┼──────────┼───────┼──┼─────┼──────┼──────┼──────┼───────┼───────┼───────┤"
xh = xh + 1
Printer.Print "│" + biao.Resultset!代码 _
; "│" + biao.Resultset!药品名称 _
; "│" + biao.Resultset!规格 _
; "│" + biao.Resultset!单位 _
; "│" + biao.Resultset!零售价 _
; "│" + iszero1(biao.Resultset!门诊数量) _
; "│" + iszero1(biao.Resultset!住院数量) _
; "│" + iszero1(biao.Resultset!数量合计) _
; "│" + iszero(biao.Resultset!门诊零售金额合计) _
; "│" + iszero(biao.Resultset!住院零售金额合计) _
; "│" + iszero(biao.Resultset!零售金额总合计) _
; "│"
Else
Printer.Print "├───┴──────────┴───────┴──┴─────┴──────┴──────┴──────┼───────┼───────┼───────┤"
Printer.Print "│ 合 计 │" _
+ iszero(biao.Resultset!门诊零售金额合计) _
; "│" + iszero(biao.Resultset!住院零售金额合计) _
; "│" + iszero(biao.Resultset!零售金额总合计) _
; "│"
End If
biao.Resultset.MoveNext
If biao.Resultset.EOF Then Exit For
End If
Next j
If biao.Resultset.EOF Then
Printer.Print "└────────────────────────────────────────────────────┴───────┴───────┴───────┘"
Printer.Print "操作员: " + mop_code + " 库保员:"
Exit For
Else
Printer.Print "└───┴──────────┴───────┴──┴─────┴──────┴──────┴──────┴───────┴───────┴───────┘"
Printer.Print "操作员: " + mop_code + " 库保员:"
Printer.NewPage
End If
Next i
Printer.EndDoc
MsgBox "打印结束", , "确定"
End If
End Sub
Private Sub quit_com_Click()
Unload Me
End Sub
Private Sub show_att_Change()
Dim db As Database
Dim rs As Recordset
If Not (show_att.Text = "") Then
opendb db, rs, "select * from pharmic_function where f_name like '" + show_att.Text + "'", False
drug_att = rs!f_id
rs.Close
db.Close
Else
drug_att = "%"
End If
End Sub
Private Sub show_att_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
show_big.SetFocus
End If
End Sub
Private Sub show_big_Change()
big_id = ""
If Not (show_big.Text = "") Then
Dim db As Database
Dim rs As Recordset
opendb db, rs, "select * from pharmic_greatgenus where G_NAME like '" + show_big.Text + "'", False
big_id = rs!G_id
rs.Close
db.Close
show_little = ""
sort_little.DataSourceName = dbfname
sort_little.Connect = dbfstr
sort_little.SQL = "select * from pharmic_littlegenus WHERE G_id='" + big_id + "'"
sort_little.Refresh
show_little.ListField = "L_NAME"
little_id = big_id + "%"
browse_com_Click
End If
End Sub
Private Sub show_big_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
show_little.SetFocus
End If
End Sub
Private Sub show_little_Change()
Dim db As Database
Dim rs As Recordset
If Not (big_id = "" Or show_little = "") Then
opendb db, rs, "select * from pharmic_littlegenus where G_id='" + big_id + "'and L_NAME like '" + show_little.Text + "'", False
little_id = rs!L_id
rs.Close
db.Close
End If
End Sub
Private Sub show_little_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
browse_com.SetFocus
End If
End Sub
Private Sub updown_b_DownClick()
'日期下调一天
If b_date.Text <> "" Then
b_date.Text = CStr(CDate(b_date.Text) - 1)
End If
End Sub
Private Sub updown_b_UpClick()
'日期上调一天
If b_date.Text <> "" Then
b_date.Text = CStr(CDate(b_date.Text) + 1)
End If
End Sub
Private Sub updown_e_DownClick()
'日期下调一天
If e_date.Text <> "" Then
e_date.Text = CStr(CDate(e_date.Text) - 1)
End If
End Sub
Private Sub updown_e_UpClick()
'日期上调一天
If e_date.Text <> "" Then
e_date.Text = CStr(CDate(e_date.Text) + 1)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -