医院药品管理系统分析与设计 第11页 Private Sub cmdEnter_Click() ‘还原数据库
On Error Resume Next
' 设置“CancelError”为 True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' 设置标志
CommonDialog1.Flags = cdlOFNHideReadOnly
Me.CommonDialog1.DialogTitle = "请输入目标文件"
Me.CommonDialog1.ShowOpen
Data1.DatabaseName = Me.CommonDialog1.FileName
Data1.Refresh
Option3.Value = True
ErrHandler:
' 用户按了“取消”按钮
Data1.DatabaseName = App.Path & "\date\date.mdb"
End Sub
Private Sub cmdF_Click()
On Error Resume Next
If Option3.Value = True Then
If Combo5.Text = "" Then
MsgBox ("请输入要查询的条件")
Combo5.SetFocus
ElseIf Text1.Text = "" Then
MsgBox ("请输入要查询的条件")
Text1.SetFocus
Else
Data1.Recordset.FindFirst Combo5.Text & "='" & Text1.Text & "'"
If Data1.Recordset.NoMatch Then ‘查找记录
MsgBox ("没有这种药品")
End If
End If
ElseIf Option4.Value = True Then
If Combo6.Text = "" Then
MsgBox ("请输入要查询的条件")
Combo6.SetFocus
ElseIf Text1.Text = "" Then
MsgBox ("请输入要查询的条件")
Text1.SetFocus
Else
Data1.Recordset.FindFirst Combo6.Text & "='" & Text1.Text & "'"
If Data1.Recordset.NoMatch Then
MsgBox ("没有此供货商")
End If
End If
End If
End Sub
Private Sub cmdF_LostFocus()
Text1.Text = ""
End Sub
Private Sub cmdFind_Click()
Frame1.Visible = True
Image1.Visible = False
If Option3.Value = True Then
Option1.Value = True
ElseIf Option4.Value = True Then
Option2.Value = True
End If
End Sub
Private Sub cmdOut_Click()
On Error Resume Next
If cmdOut.Caption = "出仓(&O)" Then
txtFields(9).SetFocus
txtFields(9).SelStart = 0
txtFields(9).SelLength = Len(txtFields(9).Text)
cmdOut.Caption = "确定(&O)"
cmdAdd.Enabled = False
cmdDelete.Enabled = False
cmdFind.Enabled = False
cmdRefresh.Enabled = False
cmdBackup.Enabled = False
cmdEnter.Enabled = False
cmdReport.Enabled = False
cmdUpdate.Enabled = False
ElseIf cmdOut.Caption = "确定(&O)" Then
If IsNum(txtFields(9).Text) = False Then
MsgBox "“已售数量”请输入数字"
txtFields(9).Text = ""
txtFields(9).SetFocus
ElseIf Val(txtFields(9).Text) > Val(txtFields(10).Text) Then
MsgBox ("销售数量不能大于库存数量,请重新输入")
txtFields(9).SetFocus
txtFields(9).Text = ""
Else
txtFields(10).Text = txtFields(10).Text - txtFields(9).Text
txtFields(9).Text = txtFields(8).Text - txtFields(10).Text
Data1.UpdateRecord
cmdOut.Caption = "出仓(&O)"
cmdUpdate.Enabled = True
cmdAdd.Enabled = True
cmdDelete.Enabled = True
cmdFind.Enabled = True
cmdRefresh.Enabled = True
cmdBackup.Enabled = True
cmdEnter.Enabled = True
cmdReport.Enabled = True
End If
End If
End Sub
Private Sub cmdRefresh_Click()
On Error Resume Next
Data1.Refresh
If Data1.Recordset.EOF And Data1.Recordset.BOF Then
cmdDelete.Enabled = False
cmdFind.Enabled = False
Image1.Visible = True
Frame1.Visible = False
End If
End Sub
Private Sub cmdReport_Click()
On Error Resume Next
If Option3.Value = True And Option5.Value = True Then
DataReport3.Show
ElseIf Option3.Value = True Then
DataReport1.Show
ElseIf Option4.Value = True Then
DataReport2.Show
End If
End Sub
<< 上一页 [11] [12] [13] [14] [15] [16] [17] 下一页
医院药品管理系统分析与设计 第11页下载如图片无法显示或论文不完整,请联系qq752018766