?? main_dialog_ygxx.frm
字號:
VERSION 5.00
Begin VB.Form main_dialog_ygxx
BorderStyle = 1 'Fixed Single
Caption = "員工信息窗口"
ClientHeight = 1335
ClientLeft = 45
ClientTop = 330
ClientWidth = 3825
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1335
ScaleWidth = 3825
StartUpPosition = 1 '所有者中心
Begin VB.ComboBox Combo1
Height = 300
Left = 240
TabIndex = 3
Text = "Combo1"
Top = 435
Width = 3225
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 330
Left = 1935
TabIndex = 2
Top = 900
Width = 1245
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 330
Left = 510
TabIndex = 1
Top = 900
Width = 1245
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "請選擇或輸入員工編號、姓名"
ForeColor = &H000000FF&
Height = 270
Left = 210
TabIndex = 0
Top = 120
Width = 2550
End
End
Attribute VB_Name = "main_dialog_ygxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub Form_Activate()
'打開"員工信息表"
rs1.Open "select 員工編號,員工姓名 from 員工信息表 order by 員工編號", cnn, adOpenKeyset, adLockOptimistic
If rs1.BOF = False Then rs1.MoveFirst
For i = 0 To rs1.RecordCount - 1
'在combo1中添加員工編號、員工姓名
Combo1.AddItem (Trim(rs1.Fields("員工編號")) & " " & Trim(rs1.Fields("員工姓名")))
rs1.MoveNext
Next i
If Combo1.ListCount > 0 Then Combo1.ListIndex = 0
'關閉表
rs1.Close
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Command1.SetFocus '回車command1獲得焦點
End Sub
Private Sub Command1_Click()
main_qtgl_ktgl_ktfw.Label4(0).Caption = main_qtgl_ktgl.Label4(0)
rs2.Open "select * from 員工信息表 where 員工信息表.員工編號='" + Left(Combo1.text, 5) + "'or 員工信息表.員工姓名='" + Combo1.text + "'", cnn, adOpenKeyset, adLockOptimistic
If rs2.RecordCount > 0 Then
Load main_qtgl_ktgl_ktfw
main_qtgl_ktgl_ktfw.Show
main_qtgl_ktgl_ktfw.Labbh.Caption = Trim(rs2.Fields("員工編號"))
main_qtgl_ktgl_ktfw.Labxm.Caption = Trim(rs2.Fields("員工姓名"))
Unload Me
Else
MsgBox ("查無此員工!")
End If
rs2.Close
End Sub
Private Sub Command2_Click()
main_qtgl_ktgl.Enabled = True
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
main_qtgl_ktgl.Enabled = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -