frmsearch.frm
资源名称:大学人事管理系统.zip [点击查看]
上传用户:plkplk66
上传日期:2007-06-06
资源大小:686k
文件大小:10k
源码类别:
其他行业
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmsearch
- BorderStyle = 1 'Fixed Single
- Caption = "信息查询"
- ClientHeight = 2595
- ClientLeft = 5730
- ClientTop = 2160
- ClientWidth = 4230
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2595
- ScaleWidth = 4230
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton cmdcancel
- Caption = "取消"
- Height = 375
- Left = 2392
- TabIndex = 5
- Top = 1995
- Width = 1095
- End
- Begin VB.CommandButton cmdsearch
- Caption = "查询"
- Height = 375
- Left = 817
- TabIndex = 4
- Top = 1995
- Width = 1095
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- Height = 270
- Index = 1
- Left = 1890
- TabIndex = 3
- Top = 1260
- Width = 1095
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- Height = 270
- Index = 0
- Left = 1890
- TabIndex = 2
- Top = 630
- Width = 1095
- End
- Begin VB.OptionButton Option1
- Caption = "按ID"
- Height = 270
- Index = 1
- Left = 945
- TabIndex = 1
- Top = 1260
- Width = 855
- End
- Begin VB.OptionButton Option1
- Caption = "按姓名"
- Height = 270
- Index = 0
- Left = 945
- TabIndex = 0
- Top = 630
- Width = 855
- End
- Begin VB.Frame Frame1
- Caption = "查询"
- Height = 1650
- Left = 420
- TabIndex = 6
- Top = 210
- Width = 3345
- End
- Begin VB.Data Data1
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = "G:大学人事管理人事管理reshi.mdb"
- DefaultCursorType= 0 '缺省游标
- DefaultType = 2 '使用 ODBC
- Exclusive = 0 'False
- Height = 375
- Left = 210
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 0 'Table
- RecordSource = "reshi"
- Top = 2520
- Width = 2355
- End
- Begin VB.Image Image1
- BorderStyle = 1 'Fixed Single
- DataField = "photo"
- DataSource = "Data1"
- Height = 645
- Left = 4200
- Stretch = -1 'True
- Top = 2415
- Width = 645
- End
- End
- Attribute VB_Name = "frmsearch"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Sub cmdsearch_Click()
- Dim j As Integer
- Data1.Refresh
- Data1.Recordset.MoveFirst
- For I = 0 To Data1.Recordset.RecordCount - 1
- If Option1(0).Enabled = True Then
- If Trim(Text1(0).Text) = Left(Data1.Recordset.Fields("name"), 1) Or Trim(Text1(0).Text) = Left(Data1.Recordset.Fields("name"), 2) Or Trim(Text1(0).Text) = Left(Data1.Recordset.Fields("name"), 3) Or Trim(Text1(0).Text) = Right(Data1.Recordset.Fields("name"), 1) Or Trim(Text1(0).Text) = Right(Data1.Recordset.Fields("name"), 2) Or Trim(Text1(0).Text) = Mid(Data1.Recordset.Fields("name"), 2, 1) Then
- 'if Trim(Text1(1).Text) = Trim(Data1.Recordset.Fields("ID")) Then
- If Data1.Recordset.Fields("flag") = Val(1) Then
- With frmshow1
- .Text1(0).Text = Data1.Recordset.Fields("name")
- .Text1(1).Text = Data1.Recordset.Fields("ID")
- .Text1(2).Text = Data1.Recordset.Fields("profession")
- .Text1(3).Text = Data1.Recordset.Fields("sex")
- .Text1(5).Text = Data1.Recordset.Fields("location")
- .Text1(4).Text = Data1.Recordset.Fields("age")
- .Text1(6).Text = Data1.Recordset.Fields("phone")
- .Text1(7).Text = Data1.Recordset.Fields("zip")
- .Text1(8).Text = Data1.Recordset.Fields("height")
- .Text1(9).Text = Data1.Recordset.Fields("weight")
- .Text1(10).Text = Data1.Recordset.Fields("address")
- .Text1(11).Text = Data1.Recordset.Fields("email")
- .Text1(12).Text = Data1.Recordset.Fields("remark")
- .Image1.Picture = Image1.Picture
- .Enabled = True
- .Visible = True
- End With
- For j = 0 To 13
- frmshow1.Text1(j).Enabled = False
- Next j
- Exit Sub
- End If
- If Data1.Recordset.Fields("flag") = 0 Then
- With frmshow0
- .Text1(0).Text = Data1.Recordset.Fields("name")
- .Text1(1).Text = Data1.Recordset.Fields("ID")
- .Text1(2).Text = Data1.Recordset.Fields("profession")
- .Text1(3).Text = Data1.Recordset.Fields("sex")
- .Text1(4).Text = Data1.Recordset.Fields("age")
- .Text1(5).Text = Data1.Recordset.Fields("marriage")
- .Text1(6).Text = Data1.Recordset.Fields("phone")
- .Text1(7).Text = Data1.Recordset.Fields("zip")
- .Text1(8).Text = Data1.Recordset.Fields("worktime")
- .Text1(10).Text = Data1.Recordset.Fields("address")
- .Text1(11).Text = Data1.Recordset.Fields("email")
- .Text1(9).Text = Data1.Recordset.Fields("remark")
- .Image1.Picture = Image1.Picture
- .Enabled = True
- .Visible = True
- End With
- For j = 0 To 11
- frmshow0.Text1(j).Enabled = False
- Next j
- Exit Sub
- End If
- ' If Data1.Recordset.Fields("flag") = 2 Then
- ' '''''''''''''''''''
- ' End If
- Else
- Data1.Recordset.MoveNext
- End If
- End If
- Next
- ''''''''''''''''''''''''''''''''''''''''''''''''
- Data1.Recordset.MoveFirst
- For I = 0 To Data1.Recordset.RecordCount - 1
- If Option1(1).Enabled = True Then
- If Trim(Text1(1).Text) = Trim(Data1.Recordset.Fields("ID")) Then
- If Data1.Recordset.Fields("flag") = Val(1) Then
- With frmshow1
- .Text1(0).Text = Data1.Recordset.Fields("name")
- .Text1(1).Text = Data1.Recordset.Fields("ID")
- .Text1(2).Text = Data1.Recordset.Fields("profession")
- .Text1(3).Text = Data1.Recordset.Fields("sex")
- .Text1(5).Text = Data1.Recordset.Fields("location")
- .Text1(4).Text = Data1.Recordset.Fields("age")
- .Text1(6).Text = Data1.Recordset.Fields("phone")
- .Text1(7).Text = Data1.Recordset.Fields("zip")
- .Text1(8).Text = Data1.Recordset.Fields("height")
- .Text1(9).Text = Data1.Recordset.Fields("weight")
- .Text1(10).Text = Data1.Recordset.Fields("address")
- .Text1(11).Text = Data1.Recordset.Fields("email")
- .Text1(12).Text = Data1.Recordset.Fields("remark")
- .Image1.Picture = Image1.Picture
- .Enabled = True
- .Visible = True
- End With
- For j = 0 To 13
- frmshow1.Text1(j).Enabled = False
- Next j
- Exit Sub
- End If
- If Data1.Recordset.Fields("flag") = 0 Then
- With frmshow0
- .Text1(0).Text = Data1.Recordset.Fields("name")
- .Text1(1).Text = Data1.Recordset.Fields("ID")
- .Text1(2).Text = Data1.Recordset.Fields("profession")
- .Text1(3).Text = Data1.Recordset.Fields("sex")
- .Text1(4).Text = Data1.Recordset.Fields("age")
- .Text1(5).Text = Data1.Recordset.Fields("marriage")
- .Text1(6).Text = Data1.Recordset.Fields("phone")
- .Text1(7).Text = Data1.Recordset.Fields("zip")
- .Text1(8).Text = Data1.Recordset.Fields("worktime")
- .Text1(10).Text = Data1.Recordset.Fields("address")
- .Text1(11).Text = Data1.Recordset.Fields("email")
- .Text1(9).Text = Data1.Recordset.Fields("remark")
- .Image1.Picture = Image1.Picture
- .Enabled = True
- .Visible = True
- End With
- For j = 0 To 11
- frmshow0.Text1(j).Enabled = False
- Next j
- Exit Sub
- End If
- ' If Data1.Recordset.Fields("flag") = 2 Then
- ' '''''''''''''''''''
- ' End If
- Else
- Data1.Recordset.MoveNext
- End If
- End If
- Next
- End Sub
- Private Sub cmdcancel_Click()
- Unload Me
- frmmain.Enabled = True
- frmmain.Visible = True
- frmmain.SetFocus
- End Sub
- Private Sub Form_Load()
- Image1.Visible = False
- Data1.Visible = False
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- frmmain.Enabled = True
- End Sub
- '使用控件数组
- Private Sub Option1_Click(Index As Integer)
- Dim I As Integer
- For I = 0 To 1
- frmsearch.Text1(I).Enabled = False
- frmsearch.Text1(I).Text = ""
- frmsearch.Text1(I).BackColor = &H80000002
- Next I
- frmsearch.Text1(Index).Enabled = True
- frmsearch.Text1(Index).SetFocus
- frmsearch.Text1(Index).BackColor = &H80000005
- End Sub
- Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
- If KeyAscii = 13 Then
- Call cmdsearch_Click
- End If
- End Sub