主题:[原创]一个星期贴完自己写的药品进销存管理软件(九)
'文件名;FROM1.FRM
'用于基本资料的增删减工作
'接第八贴
DataRedSet.Close
Grid1.TextMatrix(0, 1) = "序号"
Grid1.TextMatrix(0, 2) = "姓名"
Grid1.TextMatrix(0, 3) = "性别"
Grid1.TextMatrix(0, 4) = "年龄"
Grid1.TextMatrix(0, 5) = "部门"
Grid1.TextMatrix(0, 6) = "备注"
Grid1.ColWidth(0) = 200
Grid1.ColWidth(1) = 600
Grid1.ColWidth(2) = 1300
Grid1.ColWidth(3) = 500
Grid1.ColWidth(4) = 600
Grid1.ColWidth(5) = 1200
Grid1.ColWidth(6) = 2000
Tree1.Nodes.Clear
Tree1.Nodes.Add , , , "所有部门"
DataRedSet.Open "select DISTINCT bm from yginfo ", DataCon, 1, 3
Do While Not DataRedSet.EOF
Tree1.Nodes.Add Tree1.Nodes(1), tvwChild, , Trim(DataRedSet.Fields(0))
DataRedSet.MoveNext
Loop
DataRedSet.Close
GetGridWith Grid1, SSTab1.Caption, 0
End Sub
Private Sub YPMCViewCmd_Click()
On Error GoTo E1
DataRedSet.Close
DataRedSet.CursorLocation = adUseClient
E1:
DataRedSet.Open "select * from ypinfo order by id", DataCon, 1, 3
Set Grid1.DataSource = DataRedSet
Set Grid1.DataSource = Nothing
If DataRedSet.RecordCount = 0 Then
Grid1.Rows = 200
Grid1.TopRow = 150
Grid1.Rows = 2
End If
DataRedSet.Close
Grid1.ColWidth(0) = 300
Grid1.TextMatrix(0, 1) = "序号"
Grid1.TextMatrix(0, 2) = "拼音代码"
Grid1.TextMatrix(0, 3) = "药品名称"
Grid1.TextMatrix(0, 4) = "规格"
Grid1.TextMatrix(0, 5) = "剂型"
Grid1.TextMatrix(0, 6) = "单位"
Grid1.TextMatrix(0, 7) = "销售上限"
Grid1.TextMatrix(0, 8) = "销售下限"
Grid1.TextMatrix(0, 9) = "库存报警数"
Grid1.TextMatrix(0, 10) = "类别"
Grid1.ColWidth(1) = 600
Grid1.ColWidth(2) = 1500
Grid1.ColWidth(3) = 2300
Grid1.ColWidth(7) = 2300
Dim i As Integer
For i = 1 To Grid1.Rows - 1
Grid1.TextMatrix(i, 7) = Grid1.TextMatrix(i, 7) & "%"
Grid1.TextMatrix(i, 8) = Grid1.TextMatrix(i, 8) & "%"
Grid1.TextMatrix(i, 9) = Format(Grid1.TextMatrix(i, 9), "###,###,###.0#")
Next i
TreeView1.Nodes.Clear
TreeView1.Nodes.Add , , , "所有类别"
DataRedSet.Open "select yplb from yplb ", DataCon, 1, 3
Do While Not DataRedSet.EOF
TreeView1.Nodes.Add TreeView1.Nodes(1), tvwChild, , Trim(DataRedSet.Fields(0))
DataRedSet.MoveNext
Loop
GetGridWith Grid1, SSTab1.Caption, 0
End Sub
Private Sub 帮助_Click()
MsgBox "正在编写....."
End Sub
Private Sub dw管理_Click()
SSTab1.Tab = 4
End Sub
Private Sub dw管理2_Click()
SSTab1.Tab = 4
End Sub
Private Sub 保存设置_Click()
SaveGridWith Grid1, SSTab1.Caption, 0
End Sub
Private Sub 导出Excel_Click()
If Grid1.Text = "" Then
MsgBox "无内容可导出", vbOKOnly + vbInformation, "导出Excel"
Exit Sub
End If
ToExcel Grid1, SSTab1.Caption
End Sub
Private Sub 供应商管理_Click()
SSTab1.Tab = 0
End Sub
Private Sub 供应商管理2_Click()
SSTab1.Tab = 0
End Sub
Private Sub jx管理_Click()
SSTab1.Tab = 2
End Sub
Private Sub jx管理2_Click()
SSTab1.Tab = 2
End Sub
Private Sub 默认风格_Click()
SetGridWith GridObject, FormCaption
End Sub
Private Sub 删除1_Click()
DelCmd_Click
End Sub
Private Sub scfactory管理_Click()
SSTab1.Tab = 1
End Sub
Private Sub scfactory管理2_Click()
SSTab1.Tab = 1
End Sub
Private Sub 添加1_Click()
AddCmd_Click
End Sub
Private Sub 退出_Click()
Unload Me
End Sub
Private Sub 修改1_Click()
EditCmd_Click
End Sub
Private Sub 药品名称管理_Click()
SSTab1.Tab = 3
End Sub
Private Sub 药品名称管理2_Click()
SSTab1.Tab = 3
End Sub
Function SetFousSatrt(obj As Object)
obj.SelStart = 0
obj.SelLength = Len(obj)
End Function