📄 frmemployeeinformation.frm
字号:
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmEmployeeInformation.frx":0634
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmEmployeeInformation.frx":094E
Key = ""
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmEmployeeInformation.frx":0C68
Key = ""
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmEmployeeInformation.frx":0F82
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmEmployeeInformation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim Cmd As New ADODB.Command
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdNext_Click()
On Error GoTo ErrorHandle
Dim varTemp As String
If rs2.State = adStateOpen Then
rs2.Close
End If
With rs
.MoveNext
If .EOF Then
.MovePrevious
End If
End With
If rs("工号") <> "" Then
varTemp = rs("工号")
Sql = "select * from 员工详细资料 where 工号= '" & varTemp & "'"
rs2.Open Sql, Conn, adOpenKeyset, adLockPessimistic
Set txt应聘日期.DataSource = rs2
txt应聘日期.DataField = "填表聘用日期"
Set txt身份证号码.DataSource = rs2
txt身份证号码.DataField = "身份证号码"
Set txt性别.DataSource = rs2
txt性别.DataField = "性别"
Set txt家庭地址.DataSource = rs2
txt家庭地址.DataField = "家庭住址"
End If
Exit Sub
ErrorHandle:
Exit Sub
End Sub
Private Sub cmdPreview_Click()
Dim Sql As String
Cmd.CommandText = "delete * from 员工详细资料报表"
Cmd.Execute
Cmd.CommandText = "insert into 员工详细资料报表 select * from 员工详细资料 where 工号= '" & Trim(txt工号.Text) & "'"
Cmd.Execute
Sql = "select * from 员工详细资料报表"
CrystalReport1.SQLQuery = Sql
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1
End Sub
Private Sub cmdPrevious_Click()
On Error GoTo ErrorHandle
Dim varTemp As String
If rs2.State = adStateOpen Then
rs2.Close
End If
With rs
.MovePrevious
If .BOF Then
.MoveNext
End If
End With
If rs("工号") <> "" Then
varTemp = rs("工号")
Sql = "select * from 员工详细资料 where 工号= '" & varTemp & "'"
rs2.Open Sql, Conn, adOpenKeyset, adLockPessimistic
Set txt应聘日期.DataSource = rs2
txt应聘日期.DataField = "填表聘用日期"
Set txt身份证号码.DataSource = rs2
txt身份证号码.DataField = "身份证号码"
Set txt性别.DataSource = rs2
txt性别.DataField = "性别"
Set txt家庭地址.DataSource = rs2
txt家庭地址.DataField = "家庭住址"
End If
Exit Sub
ErrorHandle:
Exit Sub
End Sub
Private Sub cmdPrint_Click()
Dim Sql As String
Sql = "select * from 员工详细资料报表"
CrystalReport1.SQLQuery = Sql
CrystalReport1.Destination = crptToPrinter
CrystalReport1.Action = 1
End Sub
Private Sub cmdSearch_Click()
Dim Sql As String
Dim varTemp As String
Dim Level As String
If rs.State = adStateOpen Then
rs.Close
End If
If rs2.State = adStateOpen Then
rs2.Close
End If
If Option2.Value = True Then
Sql = "select * from 员工资料 where 工号= '" & Trim(txt员工工号.Text) & "'"
rs.Open Sql, Conn, adOpenKeyset, adLockPessimistic
If rs.RecordCount = 0 Then
MsgBox "找不到指定的员工记录,请重新选择!"
Exit Sub
End If
varTemp = rs("工号")
Set txt工号.DataSource = rs
txt工号.DataField = "工号"
Set txt姓名.DataSource = rs
txt姓名.DataField = "姓名"
Set txt等级.DataSource = rs
txt等级.DataField = "等级"
Set txt担保人工号.DataSource = rs
txt担保人工号.DataField = "担保人工号"
Set txt担保人姓名.DataSource = rs
txt担保人姓名.DataField = "担保人姓名"
Set txt担保人等级.DataSource = rs
txt担保人等级.DataField = "担保人等级"
Sql = "select * from 员工详细资料 where 工号= '" & varTemp & "'"
rs2.Open Sql, Conn, adOpenKeyset, adLockPessimistic
Set txt应聘日期.DataSource = rs2
txt应聘日期.DataField = "填表聘用日期"
Set txt身份证号码.DataSource = rs2
txt身份证号码.DataField = "身份证号码"
Set txt性别.DataSource = rs2
txt性别.DataField = "性别"
Set txt家庭地址.DataSource = rs2
txt家庭地址.DataField = "家庭住址"
End If
If Option1.Value = True Then
If optLevelA.Value = True Then
Level = "A"
End If
If optLevelB.Value = True Then
Level = "B"
End If
If optLevelC.Value = True Then
Level = "C"
End If
If optLevelD.Value = True Then
Level = "D"
End If
Sql = "select * from 员工资料 where 等级= '" & Level & "'"
rs.Open Sql, Conn, adOpenKeyset, adLockPessimistic
If rs.RecordCount = 0 Then
MsgBox "找不到指定的员工记录,请重新选择!"
Exit Sub
End If
rs.MoveFirst
varTemp = rs("工号")
Set txt工号.DataSource = rs
txt工号.DataField = "工号"
Set txt姓名.DataSource = rs
txt姓名.DataField = "姓名"
Set txt等级.DataSource = rs
txt等级.DataField = "等级"
Set txt担保人工号.DataSource = rs
txt担保人工号.DataField = "担保人工号"
Set txt担保人姓名.DataSource = rs
txt担保人姓名.DataField = "担保人姓名"
Set txt担保人等级.DataSource = rs
txt担保人等级.DataField = "担保人等级"
Sql = "select * from 员工详细资料 where 工号= '" & varTemp & "'"
rs2.Open Sql, Conn, adOpenKeyset, adLockPessimistic
Set txt应聘日期.DataSource = rs2
txt应聘日期.DataField = "填表聘用日期"
Set txt身份证号码.DataSource = rs2
txt身份证号码.DataField = "身份证号码"
Set txt性别.DataSource = rs2
txt性别.DataField = "性别"
Set txt家庭地址.DataSource = rs2
txt家庭地址.DataField = "家庭住址"
End If
If Option3.Value = True Then
Sql = "select * from 员工资料 where 应聘日期 between #" & DTPicker1.Value & "# and #" & DTPicker2.Value & "#"
rs.Open Sql, Conn, adOpenKeyset, adLockPessimistic
If rs.RecordCount = 0 Then
MsgBox "找不到指定的员工记录,请重新选择!"
Exit Sub
End If
rs.MoveFirst
varTemp = rs("工号")
Set txt工号.DataSource = rs
txt工号.DataField = "工号"
Set txt姓名.DataSource = rs
txt姓名.DataField = "姓名"
Set txt等级.DataSource = rs
txt等级.DataField = "等级"
Set txt担保人工号.DataSource = rs
txt担保人工号.DataField = "担保人工号"
Set txt担保人姓名.DataSource = rs
txt担保人姓名.DataField = "担保人姓名"
Set txt担保人等级.DataSource = rs
txt担保人等级.DataField = "担保人等级"
Sql = "select * from 员工详细资料 where 工号= '" & varTemp & "'"
rs2.Open Sql, Conn, adOpenKeyset, adLockPessimistic
Set txt应聘日期.DataSource = rs2
txt应聘日期.DataField = "填表聘用日期"
Set txt身份证号码.DataSource = rs2
txt身份证号码.DataField = "身份证号码"
Set txt性别.DataSource = rs2
txt性别.DataField = "性别"
Set txt家庭地址.DataSource = rs2
txt家庭地址.DataField = "家庭住址"
End If
End Sub
Private Sub Command2_Click()
frmYGZL_YGGH.Show 1
End Sub
Private Sub Form_Load()
Dim ConnStr As String
ConnStr = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:\system\database\system.mdb"
Conn.Open ConnStr
rs.CursorLocation = adUseClient
rs2.CursorLocation = adUseClient
Option2.Value = True
Frame3.Visible = True
Frame4.Visible = False
Frame5.Visible = False
Cmd.ActiveConnection = Conn
End Sub
Private Sub Form_Unload(Cancel As Integer)
Cmd.CommandText = "delete * from 员工详细资料报表"
Cmd.Execute
Conn.Close
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
Frame3.Visible = False
Frame4.Visible = True
Frame5.Visible = False
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Frame3.Visible = True
Frame4.Visible = False
Frame5.Visible = False
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = True
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
Select Case Button.Key
Case "Search"
cmdSearch_Click
Case "Preview"
cmdPreview_Click
Case "Print"
cmdPrint_Click
Case "Previous"
cmdPrevious_Click
Case "Next"
cmdNext_Click
Case "Close"
cmdClose_Click
End Select
End Sub
Private Sub txt员工工号_Change()
txt员工工号.Text = UCase(txt员工工号.Text)
txt员工工号.SelStart = Len(txt员工工号.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -