⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yk_form_list.frm

📁 这是一个医院管理系统中的院长查询模块
💻 FRM
📖 第 1 页 / 共 3 页
字号:
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.FontName = "隶书"
            Printer.Print Space(34) + yuanming
            Printer.FontSize = 15
            Printer.FontName = "隶书"
            Printer.Print Space(44) + "药 库 药 品 盘 点、 销 售 统 计 表 "
        
        
            Printer.Print ""
            Printer.FontSize = 9.5
            
            Printer.Print " 类型:" + CStr(drug_kind.Text) + Space(5) + MEX + Space(38) + CStr(b_date) + "--" + CStr(e_date) + 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) _
                                    ; "│" + Space(10) _
                                    ; "│" + iszero1(biao.Resultset!上月结存数量) _
                                    ; "│" + iszero1(biao.Resultset!本月入库数量) _
                                    ; "│" + iszero1(biao.Resultset!本月退库数量) _
                                    ; "│" + iszero1(biao.Resultset!本月出库数量) _
                                    ; "│" + iszero1(biao.Resultset!本月返库数量) _
                                    ; "│" + iszero1(biao.Resultset!本月调价数量) _
                                    ; "│" + 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 = "1" Or report_id = "2" Then
        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
        '分页打印
        
        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
            If report_id = "1" Then Printer.Print "                                             药库 (药品,卫生材料) 入库核算表  "
            If report_id = "2" Then 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 "│代  码│   药  品  名  称   │   规    格   │单位│ 零售单价 │ 批发单价 │ 购入单价 │ 数    量 │零 售 总 金 额│批 发 总 金 额│进 价 总 金 额│加 成 率│毛 利 率│让  利  收  入│"
             '打印记录
            Printer.Print "├───┼──────────┼───────┼──┼─────┼─────┼─────┼─────┼───────┼───────┼───────┼────┼────┼───────┤"
                    
            For j = 1 To mline
                
                If Not biao.Resultset.EOF Then
                    If Trim(biao.Resultset!代码) <> "Z99999" Then
                        xh = xh + 1
                        Printer.Print "│" + 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!单位))) _
                                    ; "│" + biao.Resultset!零售单价 _
                                    ; "│" + biao.Resultset!批发单价 _
                                    ; "│" + biao.Resultset!购入单价 _
                                    ; "│" + biao.Resultset!库存数量 _
                                    ; "│" + biao.Resultset!零售总金额 _
                                    ; "│" + biao.Resultset!批发总金额 _
                                    ; "│" + biao.Resultset!进价总金额 _
                                    ; "│" + biao.Resultset!加成率 _
                                    ; "│" + biao.Resultset!毛利率 _
                                    ; "│" + iszero(biao.Resultset!让利收入) _
                                    ; "│"
                    Else
                        Printer.Print "├───┴──────────┴───────┴──┼─────┼─────┼─────┼─────┼───────┼───────┼───────┼────┼────┼───────┤"
                        Printer.Print "│           合               计                    │" _
                                        ; biao.Resultset!零售单价 _
                                        ; "│" + biao.Resultset!批发单价 _
                                        ; "│" + biao.Resultset!购入单价 _
                                        ; "│" + biao.Resultset!库存数量 _
                                        ; "│" + biao.Resultset!零售总金额 _
                                        ; "│" + biao.Resultset!批发总金额 _
                                        ; "│" + biao.Resultset!进价总金额 _
                                        ; "│" + biao.Resultset!加成率 _
                                        ; "│" + 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 + -