药品库房管理系统+VB开题报告答辩PPT外文翻译(十一)
.Fields("批号")
End If
Else
Label23.ForeColor = &HFF0000
Label23.Caption = "库房中没有[" & Text18.Text & "],请添加新品种!"
Command2.Enabled = False
Command1.Enabled = True
Combo1.Locked = False
Text4.Locked = False
Text5.Locked = False
Combo1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text17.Text = "请填写备注"
End If
End With
Else
Command1.Enabled = False
Command2.Enabled = False
Label23.ForeColor = &H12&
Label23.Caption = "代码库中没有[" & Text1.Text & "]这个代码,应先编制代码!"
End If
End With
Exit Sub
err3:
MsgBox "输入了非法字符或数据项填写不完整!"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活动窗口:" & frminput.Caption
End Sub
Private Sub Text3_GotFocus()
Text3.SelStart = 0
Text3.SelLength = Len(Text3.Text)
End Sub
Private Sub Text4_GotFocus()
Text4.SelStart = 0
Text4.SelLength = Len(Text4.Text)
End Sub
Private Sub Text5_GotFocus()
Text5.SelStart = 0
Text5.SelLength = Len(Text5.Text)
End Sub
Private Sub Text6_GotFocus()
Text6.SelStart = 0
Text6.SelLength = Len(Text6.Text)
End Sub
Private Sub Text7_GotFocus()
Text7.SelStart = 0
Text7.SelLength = Len(Text7.Text)
End Sub
Private Sub Text17_GotFocus()
Text17.SelStart = 0
Text17.SelLength = Len(Text17.Text)
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text18_GotFocus()
Text18.SelStart = 0
Text18.SelLength = Len(Text18.Text)
End Sub
Private Sub Text6_Change()
On Error GoTo err0
With Adodc3
.RecordSource = "select 名称,代码 from othercode where 代码='" & Text6.Text & "'"
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Text6.Text = .Recordset.Fields("名称")
End If
End With
Exit Sub
err0:
MsgBox "数据库连接失败!"
End Sub
Private Sub Text18_Change()
On Error GoTo err5
With Adodc2
.RecordSource = "select * from " & frmmain.kcode & " where 代码='" & Text18.Text & "'"
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Text1.Text = .Recordset.Fields(1)
Text1.Locked = True
Else
Command1.Enabled = False
End If
End With
Exit Sub
err5:
MsgBox "数据库连接失败!"
End Sub
6:主界面设计:
代码设计:
Private Sub menu22_Click()
frmsercho.Show
End Sub
Private Sub menu31_Click()
If frmlogin.userright = "0" Then
frmclear.Show
Else
MsgBox "只能超级用户才能执行此操作!"
End If
End Sub