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

📄 yj3_form_list.frm

📁 这是一个医院管理系统中的院长查询模块
💻 FRM
📖 第 1 页 / 共 3 页
字号:
        b_date.Text = Date
        b_date.Text = DateAdd("m", -1, b_date.Text)
        b_date.Text = DateAdd("d", 1, b_date.Text)
        b_date.SetFocus
        Exit Sub
    End If
    If e_date.Text > Date Or e_date.Text < "2000-01-01" Then
        MsgBox "输入年限超出范围", , "提示"
        e_date.Text = Date
        e_date.SetFocus
        Exit Sub
    End If
    
    biao.SQL = "yj3_form_list '" + CStr(b_date.Text) + "','" + CStr(e_date.Text) + "','" + mkind_code + "','" + drug_att + "','" + little_id + "'"
    biao.Refresh
    print_COM.Enabled = True
End Sub



Private Sub drug_kind_Click()

    If drug_kind.Text = "西  药" Then mkind_code = "A"
    If drug_kind.Text = "中成药" Then mkind_code = "B"
    If drug_kind.Text = "材  料" Then mkind_code = "D"
   
   

    little_id = "%"
    sort_big.SQL = "select * from pharmic_greatgenus where G_kind='" + mkind_code + "'order by G_id"
    sort_big.Refresh
    show_big.ListField = "G_NAME"
    show_big.Text = ""
    show_little.Text = ""
    show_att = ""
    drug_att = "%"
    sort_att.DataSourceName = dbfname
    sort_att.Connect = dbfstr
    sort_att.SQL = "select * from pharmic_function where f_kind='" + mkind_code + "'"
    sort_att.Refresh
End Sub

Private Sub drug_kind_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        show_att.SetFocus
    End If
End Sub


Private Sub Form_Load()
    b_date.Text = Date
    b_date.Text = DateAdd("m", -1, b_date.Text)
    e_date.Text = Date
    b_date.Text = DateAdd("d", 1, b_date.Text)
    biao.DataSourceName = dbfname
    biao.Connect = dbfstr
    
    sort_att.DataSourceName = dbfname
    sort_att.Connect = dbfstr
    sort_little.DataSourceName = dbfname
    sort_little.Connect = dbfstr
    sort_big.DataSourceName = dbfname
    sort_big.Connect = dbfstr
    
    drug_kind.AddItem "西  药"
    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
    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(drug_kind.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 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 + "%"
    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 + -