📄 stuff_form_list.frm
字号:
Begin VB.Label Label1
Caption = "类别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Index = 0
Left = 90
TabIndex = 11
Top = 240
Width = 615
End
Begin VB.Label Label1
Caption = "材料类型"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 240
Index = 1
Left = 90
TabIndex = 4
Top = 645
Width = 1080
End
Begin VB.Label Label1
Caption = "...详细"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 240
Index = 2
Left = 3810
TabIndex = 3
Top = 645
Width = 1080
End
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "stuff_form_list.frx":033D
Height = 5715
Left = 90
OleObjectBlob = "stuff_form_list.frx":034C
TabIndex = 5
Top = 1020
Width = 9315
End
End
Attribute VB_Name = "stuff_form_list"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim great_id As String
Dim little_id As String
Dim mkind_code As String
Private Sub browse_com_Click()
If (Not IsDate(begin_date.Text)) Or begin_date.Text < "2000-01-01" Or begin_date > Date Then
MsgBox "起始日期错误", 32, "提示"
begin_date.SetFocus
Exit Sub
End If
If (Not IsDate(end_date.Text)) Or end_date.Text < "2000-01-01" Or end_date > Date Then
MsgBox "终止日期错误", 32, "提示"
end_date.SetFocus
Exit Sub
End If
biao.SQL = "stuff_form_list '" + CStr(CDate(begin_date)) + "','" + CStr(CDate(CDate(end_date) + 1)) + "','" + mkind_code + "','" + little_id + "'"
biao.Refresh
End Sub
Private Sub Form_Load()
biao.DataSourceName = dbfname
biao.Connect = dbfstr
end_date.Text = Date
begin_date.Text = DateAdd("m", -1, Date)
begin_date.Text = DateAdd("d", 1, begin_date.Text)
data_little.DatabaseName = dbfname
data_little.Connect = dbfstr
data_little.RecordSource = "select * from stuff_littlekind WHERE G_id=''"
data_little.Refresh
show_little.ListField = "L_NAME"
data_great.DatabaseName = dbfname
data_great.Connect = dbfstr
'''''隐藏主菜单''''''''''''''
Form3.Visible = False
Form3.Enabled = False
'''''''''''''''''''''''
stuff_kind.AddItem "卫生材料"
stuff_kind.AddItem "卫杂材料"
stuff_kind.AddItem "其他材料"
stuff_kind.Text = "卫生材料"
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
If biao.SQL = "" Then
MsgBox "没有数据", , "错误"
Exit Sub
End If
If biao.Resultset.EOF And biao.Resultset.BOF Then
MsgBox "没有数据", , "错误"
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.FontName = "隶书"
Printer.Print Space(30) + yuanming + " 材 料 盘 点 表"
Printer.FontSize = 9.5
Printer.Print ""
Printer.Print " [ " + stuff_kind.Text + "(" + show_great.Text + " ) ]" + Space(38) + CStr(begin_date.Text) + "--" + CStr(end_date.Text) + Space(55) + "第" + CStr(s) + "页/共" + CStr(mpage) + "页"
Printer.FontName = "宋体"
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(6) _
; "│" + Space(6) _
; "│" + Space(30) _
; "│" + Space(20) _
; "│" + 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!本期结存数量) _
; "│"
Printer.Print "│" + Space(6 - Len(CStr(xh))) + CStr(xh) _
; "│" + CStr(biao.Resultset!代码) _
; "│" + printstr(biao.Resultset!材料名称, 30) _
+ printstr(biao.Resultset!规格, 20) _
+ printstr(biao.Resultset!单位, 4) _
+ 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!本期结存金额) _
; "│"
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_great_Change()
great_id = "%"
little_id = "%"
If Not (show_great.Text = "") Then
Dim db As Database
Dim rs As Recordset
opendb db, rs, "select * from stuff_greatkind where G_NAME = '" + show_great.Text + "'", False
great_id = rs!G_id
rs.Close
db.Close
show_little = ""
data_little.DatabaseName = dbfname
data_little.Connect = dbfstr
data_little.RecordSource = "select * from stuff_littlekind WHERE G_id='" + great_id + "'"
data_little.Refresh
show_little.ListField = "L_NAME"
little_id = great_id + "%"
Else
opendb db, rs, "select * from stuff_greatkind where G_NAME like ' '", False
rs.Close
db.Close
End If
End Sub
Private Sub show_great_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 show_great <> "" And show_little <> "" Then
opendb db, rs, "select * from stuff_littlekind where G_id='" + great_id + "'and L_NAME = '" + show_little.Text + "'", False
little_id = rs!L_id
rs.Close
db.Close
End If
End Sub
Private Sub stuff_kind_Click()
If stuff_kind.Text = "卫生材料" Then mkind_code = "H"
If stuff_kind.Text = "卫杂材料" Then mkind_code = "I"
If stuff_kind.Text = "其他材料" Then mkind_code = "J"
data_great.RecordSource = "select * from stuff_greatkind where g_kind='" + mkind_code + "' order by G_id"
data_great.Refresh
show_great.ListField = "G_NAME"
show_great.Text = ""
show_little.Text = ""
great_id = "%"
little_id = "%"
End Sub
Private Sub UpDown_begin_DownClick()
If IsDate(begin_date) Then
begin_date.Text = CStr(CDate(begin_date.Text) - 1)
If begin_date.Text < "2000-01-01" Then begin_date = "2000-01-01"
If begin_date.Text > Date Then begin_date = Date
End If
End Sub
Private Sub UpDown_begin_UpClick()
If IsDate(begin_date) Then
begin_date.Text = CStr(CDate(begin_date.Text) + 1)
If begin_date.Text < "2000-01-01" Then begin_date = "2000-01-01"
If begin_date.Text > Date Then begin_date = Date
End If
End Sub
Private Sub UpDown_end_DownClick()
If IsDate(end_date) Then
end_date.Text = CStr(CDate(end_date.Text) - 1)
If end_date.Text < "2000-01-01" Then end_date = "2000-01-01"
If end_date.Text > Date Then end_date = Date
End If
End Sub
Private Sub UpDown_end_UpClick()
If IsDate(end_date) Then
end_date.Text = CStr(CDate(end_date.Text) + 1)
If end_date.Text < "2000-01-01" Then end_date = "2000-01-01"
If end_date.Text > Date Then end_date = Date
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -