?? frm_bfwh.frm
字號:
End
Begin VB.ComboBox Combo2
BackColor = &H00C0C0FF&
Height = 300
ItemData = "frm_bfwh.frx":0015
Left = 720
List = "frm_bfwh.frx":0025
TabIndex = 9
Top = 600
Width = 2415
End
Begin VB.ComboBox Combo1
BackColor = &H00C0C0FF&
Height = 300
ItemData = "frm_bfwh.frx":005F
Left = 4080
List = "frm_bfwh.frx":0061
TabIndex = 7
Top = 240
Width = 1335
End
Begin VB.TextBox Text2
BackColor = &H00C0C0FF&
Height = 300
Left = 2640
TabIndex = 5
Top = 240
Width = 495
End
Begin VB.TextBox Text1
BackColor = &H00C0C0FF&
Height = 300
Left = 720
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.Label Label6
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "備注"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 12
Top = 1080
Width = 495
End
Begin VB.Label Label5
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "負責人"
ForeColor = &H00C00000&
Height = 375
Left = 3240
TabIndex = 10
Top = 720
Width = 615
End
Begin VB.Label Label4
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "類別"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 8
Top = 720
Width = 615
End
Begin VB.Label Label3
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "所屬科室"
ForeColor = &H00C00000&
Height = 375
Left = 3240
TabIndex = 6
Top = 360
Width = 735
End
Begin VB.Label Label2
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "床位數"
ForeColor = &H00C00000&
Height = 255
Left = 1920
TabIndex = 4
Top = 360
Width = 735
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "病房號"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 2
Top = 360
Width = 855
End
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 255
Left = 720
TabIndex = 19
Top = 2160
Width = 1335
End
End
Attribute VB_Name = "frm_bfwh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click()
Adodc1.RecordSource = "select * from Table_bfxx order by 病房號"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Val(Adodc1.Recordset.Fields("病房號")) + 1
Else
Text1.Text = 100
End If
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Text2.SetFocus
Cmd_save.Enabled = True
Cmd_add.Enabled = False
End Sub
Private Sub Cmd_cancel_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Cmd_add.Enabled = True
Cmd_save.Enabled = False
Cmd_edit.Enabled = True
Adodc1.RecordSource = "select * from Table_bfxx"
Adodc1.Refresh
Text2.SetFocus
End Sub
Private Sub Cmd_del_Click()
If Adodc1.Recordset.EOF = False Then
If Adodc1.Recordset.Fields("是否使用") = 1 Then
MsgBox "此病房正在使用中,不能夠進行刪除", 48, "醫院住院管理系統"
Else
c = MsgBox("您確認要刪除信息嗎?", 17, "醫院住院管理系統")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 64, "醫院住院管理系統"
End If
End Sub
Private Sub Cmd_edit_Click()
If Text1.Text = "" Then
MsgBox "請輸入病房號進行查詢所要修改的病房信息", 64, "醫院住院管理系統"
Else
If Not IsNumeric(Text1.Text) Then
MsgBox "輸入必須為數字"
Text1.Text = ""
Text1.SetFocus
Else
Text1.Locked = False
Adodc1.RecordSource = "select * from Table_bfxx where 病房號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text2.Text = Adodc1.Recordset.Fields("床位數")
Combo1.Text = Adodc1.Recordset.Fields("所屬科室")
Combo2.Text = Adodc1.Recordset.Fields("病房類別")
Text3.Text = Adodc1.Recordset.Fields("負責人")
Text4.Text = Adodc1.Recordset.Fields("備注")
Cmd_save.Enabled = True
Cmd_edit.Enabled = False
Else
MsgBox "沒有此房的信息", 64, "醫院住院管理系統"
End If
End If
End If
End Sub
Private Sub Cmd_save_Click()
Call main
If Text1.Text = "" Then
MsgBox "病房號不能為空", 64, "醫院住院管理系統"
Else
If Cmd_add.Enabled = False Then
Set adoRs = adoCon.Execute("insert into Table_bfxx values(" & Text1 & ",'" & Combo1 & "','" & Combo2 & "','" & Text3 & "','" & Text2 & "','" & Check1 & "','" & Text4 & "')")
MsgBox "數據保存成功!!", 64, "醫院住院管理系統"
Adodc1.Refresh
Cmd_add.Enabled = True
Cmd_edit.Enabled = True
Cmd_save.Enabled = False
ElseIf Cmd_edit.Enabled = False Then
Adodc1.Recordset.Delete
Set adoRs = adoCon.Execute("insert into Table_bfxx values(" & Text1 & ",'" & Combo1 & "','" & Combo2 & "','" & Text3 & "','" & Text2 & "','" & Check1 & "','" & Text4 & "')")
MsgBox "數據修改成功!!", 64, "醫院住院管理系統"
Adodc1.Refresh
Cmd_edit.Enabled = True
Cmd_add.Enabled = True
Cmd_save.Enabled = False
Else
End If
End If
adoCon.Close
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo2.SetFocus
Else
End If
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub
Private Sub DTPicker1_Click()
Text5.Text = DTPicker1.Value
End Sub
Private Sub DataGrid2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Adodc1.RecordSource = "select * from Table_ryxxb"
'Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text3.Text = Adodc1.Recordset.Fields("姓名")
Text4.SetFocus
DataGrid2.Visible = False
Else
DataGrid2.Visible = False
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
Adodc2.RecordSource = "select * from Table_ksb order by 科室部門編號"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Do While Adodc2.Recordset.EOF = False
Combo1.AddItem (Adodc2.Recordset.Fields("科室部門名稱"))
Adodc2.Recordset.MoveNext
Loop
Else
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Not IsNumeric(Text1.Text) Then
MsgBox "輸入必須為數字"
Text1.Text = ""
Text1.SetFocus
Else
End If
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo1.SetFocus
Else
End If
End Sub
'Private Sub Text3_Change()
'frm_ywryxx.Adodc1.RecordSource = "select * from Table_ryxxb where 姓名 like '%" + Text3.Text + "%'"
'frm_ywryxx.Adodc1.Refresh
'If frm_ywryxx.Adodc1.Recordset.RecordCount > 0 Then
'frm_ywryxx.Show
'Text3.SetFocus
'frm_ywryxx.DataGrid1.SetFocus
'Else
'Text3.SetFocus
'End If
'End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_ywryxx.Show
Else
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -