📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form 前台查询
Caption = "前台查询"
ClientHeight = 7005
ClientLeft = 60
ClientTop = 465
ClientWidth = 11265
LinkTopic = "Form1"
ScaleHeight = 7005
ScaleWidth = 11265
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Form1.frx":0000
Left = 6420
List = "Form1.frx":0016
Style = 2 'Dropdown List
TabIndex = 14
Top = 420
Width = 1455
End
Begin VB.OptionButton Option2
Caption = "按药品类别查询"
Height = 375
Left = 4800
TabIndex = 13
Top = 420
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "按药品名称查询"
Height = 375
Left = 720
TabIndex = 12
Top = 420
Width = 1815
End
Begin VB.CommandButton Command3
Caption = "下一个"
Height = 435
Left = 5220
TabIndex = 11
Top = 5580
Width = 1515
End
Begin VB.CommandButton Command2
Caption = "上一个"
Height = 495
Left = 3060
TabIndex = 10
Top = 5580
Width = 1515
End
Begin VB.TextBox Text9
DataField = "有效期至"
DataSource = "Adodc1"
Height = 375
Left = 8100
TabIndex = 9
Top = 4740
Width = 1695
End
Begin VB.TextBox Text8
DataField = "库存量"
DataSource = "Adodc1"
Height = 375
Left = 6600
TabIndex = 8
Top = 4740
Width = 1155
End
Begin VB.TextBox Text7
DataField = "单位"
DataSource = "Adodc1"
Height = 375
Left = 5460
TabIndex = 7
Top = 4740
Width = 735
End
Begin VB.TextBox Text6
DataField = "售价"
DataSource = "Adodc1"
Height = 375
Left = 4320
TabIndex = 6
Top = 4740
Width = 795
End
Begin VB.TextBox Text4
DataField = "药品名称"
DataSource = "Adodc1"
Height = 375
Left = 2220
TabIndex = 5
Top = 4740
Width = 1755
End
Begin VB.TextBox Text3
DataField = "药品编码"
DataSource = "Adodc1"
Height = 375
Left = 720
TabIndex = 4
Top = 4740
Width = 1275
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form1.frx":005A
Height = 3255
Left = 660
TabIndex = 2
Top = 1080
Width = 10035
_ExtentX = 17701
_ExtentY = 5741
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 435
Left = 8280
TabIndex = 1
Top = 420
Width = 1155
End
Begin VB.TextBox Text1
Height = 375
Left = 2580
TabIndex = 0
Top = 420
Width = 2115
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1560
Top = 6540
Visible = 0 'False
Width = 5475
_ExtentX = 9657
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=Medicine"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "Medicine"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"Form1.frx":006F
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label3
Caption = "药品代码 药品名称 售价 单位 库存 有效期 "
Height = 195
Left = 780
TabIndex = 3
Top = 4500
Width = 9915
End
End
Attribute VB_Name = "前台查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Option1.Enabled = True
Option2.Enabled = True
If Option1 Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor "
Adodc1.Refresh
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor where medicinename= '" & Text1 & "'"
Adodc1.Refresh
End If
If Option2 Then
Select Case Combo1.Text
Case "处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor where medkindcode= '1'"
Adodc1.Refresh
Case "非处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor where medkindcode= '2'"
Adodc1.Refresh
Case "中药饮片"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor where medkindcode= '3'"
Adodc1.Refresh
Case "中药材"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号 from MedInfor where medkindcode= '4'"
Adodc1.Refresh
Case "医疗器械"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor where medkindcode= '5'"
Adodc1.Refresh
Case "非药品(保健品)"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期 from MedInfor where medkindcode= '6'"
Adodc1.Refresh
End Select
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此信息!", , "提示"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至 from MedInfor "
Adodc1.Refresh
End If
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveFirst
MsgBox "当前记录为第一条", , "提示"
End If
End Sub
Private Sub Command3_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox "当前记录为最后一条", , "提示"
End If
End Sub
Private Sub Form_Load()
Text1.Enabled = False
Combo1.Enabled = False
Command2.Visible = False
Command3.Visible = False
End Sub
Private Sub Option1_Click()
Text1.Enabled = True
Text1.SetFocus
Option2.Enabled = False
Combo1.Enabled = False
Command2.Visible = False
Command3.Visible = False
End Sub
Private Sub Option2_Click()
Text1.Text = ""
Option1.Enabled = False
Combo1.Enabled = True
Text1.Enabled = False
Command2.Visible = True
Command3.Visible = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -