?? frmfind.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmfind
BackColor = &H00404040&
BorderStyle = 3 'Fixed Dialog
Caption = "多重條件選擇"
ClientHeight = 1290
ClientLeft = 45
ClientTop = 330
ClientWidth = 6000
Icon = "frmfind.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Picture = "frmfind.frx":030A
ScaleHeight = 1290
ScaleWidth = 6000
ShowInTaskbar = 0 'False
Begin VB.ComboBox Combo2
ForeColor = &H000000FF&
Height = 300
ItemData = "frmfind.frx":59F9
Left = 1080
List = "frmfind.frx":5A2F
TabIndex = 12
Top = 860
Width = 1400
End
Begin VB.ComboBox Combo1
ForeColor = &H000000FF&
Height = 300
ItemData = "frmfind.frx":5AB1
Left = 1080
List = "frmfind.frx":5AE7
TabIndex = 11
Top = 120
Width = 1400
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 4680
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.CommandButton Command2
Caption = "關閉&(C)"
Height = 320
Left = 4800
TabIndex = 5
Top = 720
Width = 1000
End
Begin VB.TextBox Text2
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 300
Left = 3360
TabIndex = 3
Top = 860
Width = 1200
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 300
Left = 1680
ScaleHeight = 270
ScaleWidth = 1920
TabIndex = 6
Top = 480
Width = 1950
Begin VB.OptionButton Option2
BackColor = &H00FFFFFF&
Caption = "與"
ForeColor = &H000000FF&
Height = 180
Left = 1320
TabIndex = 2
Top = 40
Width = 615
End
Begin VB.OptionButton Option1
BackColor = &H00FFFFFF&
Caption = "或"
ForeColor = &H000000FF&
Height = 180
Left = 120
TabIndex = 1
Top = 40
Width = 735
End
End
Begin VB.CommandButton Command1
Caption = "查找&(F)"
Height = 320
Left = 4800
TabIndex = 4
Top = 285
Width = 1000
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 300
Left = 3360
TabIndex = 0
Top = 120
Width = 1200
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查詢字段:"
Height = 180
Left = 200
TabIndex = 10
Top = 915
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查詢字段:"
Height = 180
Left = 200
TabIndex = 9
Top = 165
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查詢值:"
Height = 180
Left = 2640
TabIndex = 8
Top = 915
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查詢值:"
Height = 180
Left = 2640
TabIndex = 7
Top = 165
Width = 720
End
End
Attribute VB_Name = "frmfind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim ysf, tj1, tj2 As String
'On Error GoTo err1
If Combo1.text = "" And Combo2.text = "" Then
MsgBox "條件選擇不能同時為空!"
Else
If Option1.Value = True Then
ysf = " or "
Else
ysf = " and "
End If
If Option2.Value = True Then
ysf = " and "
Else
ysf = " or "
End If
tj1 = Combo1.text & " LIKE '" & Text1.text & "%'"
tj2 = Combo2.text & " LIKE '" & Text2.text & "%'"
With Adodc1
If Combo1.text <> "" And Combo2.text <> "" Then
.RecordSource = "select 住院證號,患者姓名,性別,年齡,地址,病種,科室類別,病房號,床位號,主治大夫,住院日期,出院日期,操作員,預交費,費用合計 from zyf where where 出院標記=true and " & tj1 & ysf & tj2
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Set frmclear.DataGrid1.DataSource = Adodc1
frmclear.Command2.Caption = "批量刪除"
frmclear.Command2.Enabled = True
frmclear.Command5.Enabled = False
Else
frmclear.Command2.Enabled = False
Set frmclear.DataGrid1.DataSource = Adodc1
MsgBox "沒有找到選定范圍內的記錄!"
End If
End If
End With
If Combo1.text = "" And Combo2.text <> "" Then
With Adodc1
.RecordSource = "select 住院證號,患者姓名,性別,年齡,地址,病種,科室類別,病房號,床位號,主治大夫,住院日期,出院日期,操作員,預交費,費用合計 from zyf where where 出院標記=true and " & tj2
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Set frmclear.DataGrid1.DataSource = Adodc1
frmclear.Command2.Caption = "批量刪除&(B)"
frmclear.Command2.Enabled = True
frmclear.Command5.Enabled = False
Else
frmclear.Command2.Enabled = False
Set frmclear.DataGrid1.DataSource = Adodc1
MsgBox "沒有找到選定范圍內的記錄!"
End If
End With
End If
If Combo1.text <> "" And Combo2.text = "" Then
With Adodc1
.RecordSource = "select 住院證號,患者姓名,性別,年齡,地址,病種,科室類別,病房號,床位號,主治大夫,住院日期,出院日期,操作員,預交費,費用合計 from zyf where 出院標記=true and " & tj1
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Set frmclear.DataGrid1.DataSource = Adodc1
frmclear.Command2.Caption = "批量刪除"
frmclear.Command2.Enabled = True
frmclear.Command5.Enabled = False
Else
frmclear.Command2.Enabled = False
Set frmclear.DataGrid1.DataSource = Adodc1
MsgBox "沒有找到選定范圍內的記錄!"
End If
End With
End If
End If
'Exit Sub
'err1:
'MsgBox "數據中沒有值為“" & Combo1.Text & "”或“ " & Combo2.Text & "”的字段!"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
frmfind.Top = (frmmain.Height - frmfind.Height) / 2 - 500
frmfind.Left = (frmmain.Width - frmfind.Width) / 2
Option1.Value = True
frmclear.Command1.Enabled = False
frmclear.Command3.Enabled = False
frmclear.Command5.Enabled = False
Adodc1.ConnectionString = frmlogin.conn
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前沒有窗口被激活"
frmclear.Command2.Caption = "選擇范圍&(S)"
frmclear.Command1.Enabled = True
frmclear.Command2.Enabled = True
frmclear.Command3.Enabled = True
frmclear.Command4.Enabled = True
frmclear.Command5.Enabled = True
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活動窗口:" & frmfind.Caption
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -