?? frm_zyxx_cx.frm
字號:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frm_zyxx_cx
BorderStyle = 3 'Fixed Dialog
Caption = "住院查詢"
ClientHeight = 630
ClientLeft = 45
ClientTop = 330
ClientWidth = 5415
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 630
ScaleWidth = 5415
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "輸入或選擇查詢條件后按回車鍵進行查詢"
ForeColor = &H00C00000&
Height = 615
Left = 0
TabIndex = 0
Top = 0
Width = 5415
Begin VB.ComboBox Combo2
Height = 300
ItemData = "frm_zyxx_cx.frx":0000
Left = 2640
List = "frm_zyxx_cx.frx":0016
Style = 2 'Dropdown List
TabIndex = 3
Top = 220
Width = 735
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frm_zyxx_cx.frx":0037
Left = 960
List = "frm_zyxx_cx.frx":0059
Style = 2 'Dropdown List
TabIndex = 2
Top = 220
Width = 1575
End
Begin VB.TextBox Text1
Height = 300
Left = 3480
TabIndex = 4
Top = 220
Width = 1815
End
Begin MSComCtl2.DTPicker DT1
Height = 300
Left = 3480
TabIndex = 5
Top = 240
Width = 1815
_ExtentX = 3201
_ExtentY = 529
_Version = 393216
Format = 30015489
CurrentDate = 38212
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "查詢條件"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 255
Left = 120
TabIndex = 1
Top = 240
Width = 975
End
End
End
Attribute VB_Name = "frm_zyxx_cx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, a
Dim b
Private Sub Combo1_Click()
If Combo1.Text = "入院時間" Or Combo1.Text = "出院時間" Then
Text1.Visible = False
DT1.Visible = True
Else
Text1.Visible = True
DT1.Visible = False
End If
End Sub
Private Sub Combo2_Click()
If Combo2.Text <> " Like" Then
i = 0
ElseIf Combo2.Text = " Like" Then
i = 1
Else
End If
If Combo1.Text = "入院時間" Or Combo1.Text = "出院時間" Then
DT1.SetFocus
Else
Text1.SetFocus
End If
End Sub
Private Sub DT1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
b = Str(DT1.Value)
If i = 0 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + "='" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
ElseIf i = 1 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + "<'" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
ElseIf i = 2 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + "<='" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
ElseIf i = 3 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + ">'" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
ElseIf i = 4 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + ">='" + b + "'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
ElseIf i = 5 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + " like '%" + b + "%'"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
Else
End If
Else
End If
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Text1.Text = "" Then
MsgBox "輸入不能為空"
Else
If Combo1.Text = "住院號" And Not IsNumeric(Text1.Text) Then
Text1.Text = ""
Text1.SetFocus
MsgBox "輸入必須為數字"
Else
a = Text1.Text
If i = 0 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + " " + Combo2.Text + " '" + a + "' and 是否出院=0"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
ElseIf i = 1 Then
frm_cxjg.Adodc1.RecordSource = "select * from Table_zyxx where " + Combo1.Text + " like '%" + a + "%' and 是否出院=0"
frm_cxjg.Adodc1.Refresh
If frm_cxjg.Adodc1.Recordset.RecordCount > 0 Then
frm_cxjg.Show
frm_cxjg.DataGrid1.Visible = True
frm_cxjg.DataGrid2.Visible = False
frm_cxjg.DataGrid3.Visible = False
frm_cxjg.DataGrid4.Visible = False
frm_cxjg.DataGrid5.Visible = False
frm_cxjg.Caption = "住院查詢"
Else
MsgBox "沒有您要查詢的相關信息", 64, "醫院住院管理系統"
End If
Else
End If
End If
End If
Else
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -