📄 frmhy_qry.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmHY_Qry
BorderStyle = 1 'Fixed Single
Caption = "化验信息"
ClientHeight = 4635
ClientLeft = 45
ClientTop = 330
ClientWidth = 6405
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4635
ScaleWidth = 6405
Begin VB.PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 480
Left = 0
Picture = "frmHY_Qry.frx":0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 7
Top = 0
Visible = 0 'False
Width = 480
End
Begin VB.Frame Frame1
Caption = "输入搜索条件"
Height = 855
Left = 360
TabIndex = 0
Top = 360
Width = 5535
Begin VB.CommandButton Command1
Caption = "搜索"
Height = 255
Left = 4800
TabIndex = 5
Top = 360
Width = 615
End
Begin VB.TextBox Text2
Height = 270
Left = 3360
TabIndex = 4
Top = 360
Width = 1215
End
Begin VB.TextBox Text1
Height = 270
Left = 1320
TabIndex = 2
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "病例编号"
Height = 255
Left = 2400
TabIndex = 3
Top = 360
Width = 855
End
Begin VB.Label Label1
Caption = "病人姓名"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 855
End
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2820
Left = 360
TabIndex = 6
Top = 1440
Width = 5535
_ExtentX = 9763
_ExtentY = 4974
_Version = 393216
AllowUserResizing= 3
End
End
Attribute VB_Name = "frmHY_Qry"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim txtsql As String
Dim msgtxt As String
Dim mrc As Recordset
Dim i As Integer
If Len(Text1.Text) = 0 Then
If Len(Text2.Text) = 0 Then
txtsql = "select treat.tpno,pname,tdno,tdate,tanos from PATIENT,TREAT where TREAT.TPNO=patient.pno and tflaga='1' "
Else
txtsql = "select treat.tpno,pname,tdno,tdate,tanos from PATIENT,TREAT where TREAT.TPNO=patient.pno and tflaga='1' and patient.Pno='" + Text2.Text + "'"
End If
Else
If Len(Text2.Text) = 0 Then
txtsql = "select treat.tpno,pname,tdno,tdate,tanos from PATIENT,TREAT where TREAT.TPNO=patient.pno and tflaga='1' and Pname='" + Text1.Text + "'"
Else
txtsql = "select treat.tpno,pname,tdno,tdate,tanos from PATIENT,TREAT where TREAT.TPNO=patient.pno and tflaga='1' and Pname='" + Text1.Text + "'and Pno='" + Text2.Text + "'"
End If
End If
Set mrc = New Recordset
mrc.Open txtsql, Conn, adOpenKeyset, adLockOptimistic
If mrc.EOF Then
MsgBox "您输入的信息没有找到匹配记录!", , "提示"
Text1.SetFocus
Else
With MSFlexGrid1
.Cols = 5
.Rows = 1
.TextMatrix(0, 0) = "病人编号"
.TextMatrix(0, 1) = "病人姓名"
.TextMatrix(0, 2) = "医生编号"
.TextMatrix(0, 3) = "化验日期"
.TextMatrix(0, 4) = "化验信息"
While Not mrc.EOF
.Rows = .Rows + 1
For i = 0 To 4
.TextMatrix(.Rows - 1, i) = Trim(mrc.Fields(i))
Next i
mrc.MoveNext
Wend
End With
End If
End Sub
Private Sub MSFlexGrid1_Click()
'With MSFlexGrid1
'If .TextMatrix(.Row, 1) = "" Then
' Exit Sub
'End If
'If MsgBox("您是" + .TextMatrix(.Row, 1), vbYesNo, "提示") = vbYes Then
' Pno = .TextMatrix(.Row, 1)
' frmchoseddep.Show
' Unload Me
'End If
'End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -