📄 formclass3.frm
字号:
VERSION 5.00
Begin VB.Form Formclass3
BorderStyle = 1 'Fixed Single
Caption = "方剂查询"
ClientHeight = 3090
ClientLeft = 45
ClientTop = 330
ClientWidth = 5595
Icon = "Formclass3.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3090
ScaleWidth = 5595
Begin VB.TextBox Text1
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Index = 0
Left = 1560
TabIndex = 3
Top = 960
Width = 2895
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 255
Left = 2280
TabIndex = 2
Top = 2520
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 1560
TabIndex = 1
Top = 1440
Width = 2895
End
Begin VB.TextBox Text1
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 1560
TabIndex = 0
ToolTipText = "提示:组成中输入的药味达到两味及以上需用"",""隔开"
Top = 1920
Width = 2895
End
Begin VB.Label Label4
Caption = "组成:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 7
Top = 1920
Width = 1575
End
Begin VB.Label Label2
Caption = "方名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 6
Top = 1440
Width = 1455
End
Begin VB.Label Label1
Caption = "方源:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 5
Top = 960
Width = 975
End
Begin VB.Label Label3
Caption = "方剂查询设置"
BeginProperty Font
Name = "华文中宋"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 4
Top = 120
Width = 2175
End
End
Attribute VB_Name = "Formclass3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
txtsql = ""
Dim sampleStr As String
sampleStr = ""
If Text1(0).text <> "" Then
If txtsql = "" Then
txtsql = "方源 ='" & Trim(Text1(0).text) & "'"
Else
txtsql = txtsql & "and 方源 ='" & Trim(Text1(0).text) & "'"
End If
End If
If Text1(1).text <> "" Then
If txtsql = "" Then
txtsql = "方名='" & Trim(Text1(1).text) & "'"
Else
txtsql = txtsql & "and 方名='" & Trim(Text1(1).text) & "'"
End If
End If
If Text1(2).text <> "" Then
aa = 1
Dim sampleArr
sampleArr = Split(Trim(Text1(2).text), ",")
For i = 0 To UBound(sampleArr)
If sampleArr(i) <> "" Then
If sampleStr = "" Then
sampleStr = "prescribe.组成 like '%" & Trim(sampleArr(i)) & "%'"
Else
sampleStr = sampleStr & "and prescribe.组成 like '%" & Trim(sampleArr(i)) & "%'"
End If
End If
Next i
If txtsql = "" Then
If sampleStr <> "" Then
txtsql = txtsql & sampleStr
End If
Else
If sampleStr <> "" Then
txtsql = txtsql & "and " & sampleStr
End If
End If
End If
If txtsql = "" Then
ss = MsgBox("你至少要输入一个条件以上才能查询!", , " 警告")
Text1(0).SetFocus
Exit Sub
End If
txtsql = "select * from prescribe where " & txtsql
Dim mrc As ADODB.Recordset
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
zzz = MsgBox("对不起,没有符合条件的方剂!", vbOKOnly, "查询")
Formclass3.ZOrder (0)
Formclass3.Text1(0).SetFocus
Exit Sub
End If
Formclass2.printstr = txtsql
classfind = True
Formclass2.Show
Formclass2.classshowtitle
Formclass2.classshowdata
Formclass2.Caption = "方剂查询结果"
Formclass2.ZOrder (0)
Unload Formclass3
End Sub
Private Sub Form_Unload(Cancel As Integer)
classfind = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -