yk_kchs.frm
来自「这是一个医院管理系统中的院长查询模块」· FRM 代码 · 共 456 行 · 第 1/2 页
FRM
456 行
EndProperty
ForeColor = &H00FF0000&
Height = 285
Index = 0
Left = 285
TabIndex = 8
Top = 90
Width = 600
End
End
Attribute VB_Name = "yk_kchs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mkind_code As String
Dim aa1 As String
Dim aa2 As String
Private Sub browse_Click()
Dim sss As String
Dim mm As String
If Option0.Value = True Then
End If
If Option1.Value = True Then
End If
If Option2.Value = True Then
End If
If Option3.Value = True Then
End If
If Option4.Value = True Then
End If
mm = "'%'"
aa2 = " "
If Combo2.Text = "西 药" Then
If Option0.Value = True Then
mm = "'0'"
aa2 = "[片剂]"
End If
If Option1.Value = True Then
mm = "'1'"
aa2 = "[外用药]"
End If
If Option2.Value = True Then
mm = "'2'"
aa2 = "[毒麻]"
End If
If Option3.Value = True Then
mm = "'3'"
aa2 = "[针剂]"
End If
If Option4.Value = True Then
mm = "'4'"
aa2 = "[大输液]"
End If
End If
sss = "yk1_tjb_store " + mkind_code + " ," + mm
biao.SQL = sss
print_COM.Enabled = True
biao.Refresh
aa1 = Combo2.Text
End Sub
Private Sub Form_Load()
Dim dbfstr As String
dbfstr = "ODBC;DATABASE=netba;UID=zc;PWD=1234"
biao.DataSourceName = "207his"
biao.Connect = dbfstr
Combo2.AddItem "西 药"
Combo2.AddItem "中成药"
Combo2.AddItem "饮 片"
Combo2.AddItem "卫 材"
Combo2.AddItem " "
Combo2.Text = " "
Option5.Value = True
Screen.MousePointer = vbDefault
print_COM.Enabled = False
End Sub
Private Sub Combo2_Click()
Frame1.Enabled = True
Option5.Value = True
If Combo2.Text = "西 药" Then
Frame1.Enabled = True
mkind_code = "'A'"
End If
If Combo2.Text = "中成药" Then
Frame1.Enabled = False
mkind_code = "'B'"
End If
If Combo2.Text = "饮 片" Then
Frame1.Enabled = False
mkind_code = "'C'"
End If
If Combo2.Text = "卫 材" Then
Frame1.Enabled = False
mkind_code = "'D'"
End If
If Combo2.Text = " " Then
Frame1.Enabled = False
mkind_code = "'%'"
End If
End Sub
Private Sub print_com_Click()
Dim xh As Integer
xh = 0
Dim i As Integer
Dim j As Integer
If biao.Resultset.RowCount = 1 Then
MsgBox "没有库存清单", , "退出"
Exit Sub
End If
Dim mnumber As Long, mline As Long, mpage As Long, mlast As Long
'分页
biao.Resultset.MoveLast
mnumber = biao.Resultset.RowCount
biao.Resultset.MoveFirst
mline = 45
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
'分页打印
For i = 1 To mpage
'打印名头
Printer.FontName = "隶书"
Printer.FontSize = 18
Printer.Print " " + yuanming
Printer.FontSize = 5
Printer.Print " "
Printer.FontSize = 15
Printer.Print " [" + CStr(Year(Date)) + "年" + CStr(Month(Date)) + "月] 药库 (药品,卫生材料) 核算表 "
Printer.Print " "
Printer.FontName = "宋体"
Printer.FontSize = 10.5
If aa1 = "西 药" Then
Printer.Print "药品类型:" + CStr(aa1) + CStr(aa2) + " 打印日期: " + CStr(Date) + Space(3) + CStr(Time) + Space(80) + "页数: " + RTrim(CStr(i)) + "/" + RTrim(CStr(mpage))
Else
Printer.Print "药品类型:" + CStr(aa1) + " 打印日期: " + CStr(Date) + Space(3) + CStr(Time) + Space(80) + "页数: " + RTrim(CStr(i)) + "/" + RTrim(CStr(mpage))
End If
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 "│"; Space(4 - DxLen(CStr(xh))) + CStr(xh) _
; "│" + CStr(biao.Resultset!代码) + Space(6 - DxLen(CStr(biao.Resultset!代码))) _
; "│" + CStr(biao.Resultset!药品名称) + Space(20 - DxLen(CStr(biao.Resultset!药品名称))) _
; "│" + CStr(biao.Resultset!规格) + Space(14 - DxLen(CStr(biao.Resultset!规格))) _
; "│" + CStr(biao.Resultset!单位) + Space(4 - DxLen(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!毛利率) _
; "│" + 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!加成率) _
; "│" + 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 "操作员: 库保员:"
Exit For
Else
Printer.Print "└──┴───┴──────────┴───────┴──┴─────┴─────┴─────┴─────┴───────┴───────┴───────┴───┴───┴───────┘"
Printer.Print "操作员: 库保员:";
Printer.NewPage
End If
Next i
Printer.EndDoc
MsgBox "打印结束", 32, "提示"
End Sub
Private Sub quit_Click()
Unload Me
Form3.Enabled = True
Form3.Show
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?