frmshow.frm
资源名称:大学人事管理系统.zip [点击查看]
上传用户:plkplk66
上传日期:2007-06-06
资源大小:686k
文件大小:13k
源码类别:
其他行业
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmstudent
- BorderStyle = 1 'Fixed Single
- Caption = "学生信息录入"
- ClientHeight = 7320
- ClientLeft = 5250
- ClientTop = 690
- ClientWidth = 5970
- LinkTopic = "Form2"
- MaxButton = 0 'False
- ScaleHeight = 7320
- ScaleWidth = 5970
- Begin VB.CommandButton cmdcancel
- Caption = "取消"
- Height = 375
- Left = 3360
- TabIndex = 32
- Top = 6825
- Width = 975
- End
- Begin VB.CommandButton cmdok
- Caption = "确定"
- Height = 375
- Left = 1575
- TabIndex = 28
- Top = 6825
- Width = 975
- End
- Begin VB.Frame Frame1
- Caption = "个人信息"
- Height = 6495
- Left = 210
- TabIndex = 0
- Top = 210
- Width = 5520
- Begin VB.TextBox txtage
- Appearance = 0 'Flat
- Height = 300
- Left = 2415
- TabIndex = 30
- Top = 1920
- Width = 645
- End
- Begin VB.Frame Frame3
- Caption = "备注"
- Height = 1455
- Left = 240
- TabIndex = 26
- Top = 4800
- Width = 5055
- Begin VB.TextBox txtremark
- Height = 1095
- Left = 120
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 27
- Top = 240
- Width = 4710
- End
- End
- Begin VB.TextBox txtweight
- Appearance = 0 'Flat
- Height = 270
- Left = 3600
- TabIndex = 24
- Top = 4320
- Width = 615
- End
- Begin VB.TextBox txtheight
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 21
- Top = 4320
- Width = 615
- End
- Begin VB.TextBox txtpostcode
- Appearance = 0 'Flat
- Height = 270
- Left = 3735
- TabIndex = 19
- Top = 2880
- Width = 1320
- End
- Begin VB.TextBox txtdepartment
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 17
- Top = 1440
- Width = 1335
- End
- Begin VB.TextBox txtID
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 15
- Top = 960
- Width = 1335
- End
- Begin VB.ComboBox cmbcity
- Appearance = 0 'Flat
- Height = 300
- Left = 1920
- TabIndex = 13
- Text = "慈溪"
- Top = 2400
- Width = 735
- End
- Begin VB.ComboBox cmbprovince
- Appearance = 0 'Flat
- Height = 300
- Left = 960
- TabIndex = 12
- Text = "浙江"
- Top = 2400
- Width = 735
- End
- Begin VB.ComboBox cmbsex
- Appearance = 0 'Flat
- Height = 300
- Left = 960
- TabIndex = 11
- Text = "男"
- Top = 1920
- Width = 645
- End
- Begin VB.TextBox txtname
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 4
- Top = 525
- Width = 1335
- End
- Begin VB.TextBox txtphone
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 3
- Top = 2880
- Width = 1335
- End
- Begin VB.TextBox txtaddress
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 2
- Top = 3360
- Width = 4095
- End
- Begin VB.TextBox txtemail
- Appearance = 0 'Flat
- Height = 270
- Left = 960
- TabIndex = 1
- Top = 3840
- Width = 4095
- End
- Begin VB.Label Label16
- Caption = "点击此处添加照片"
- Height = 435
- Left = 3990
- TabIndex = 33
- Top = 1155
- Width = 750
- End
- Begin VB.Label Label15
- Caption = "岁"
- Height = 225
- Left = 3255
- TabIndex = 31
- Top = 1950
- Width = 225
- End
- Begin VB.Label Label14
- Caption = "年龄:"
- Height = 225
- Left = 1890
- TabIndex = 29
- Top = 1950
- Width = 540
- End
- Begin VB.Image Image1
- BorderStyle = 1 'Fixed Single
- Height = 1695
- Left = 3675
- Stretch = -1 'True
- Top = 525
- Width = 1380
- End
- Begin VB.Label Label13
- Caption = "kg"
- Height = 255
- Left = 4320
- TabIndex = 25
- Top = 4320
- Width = 255
- End
- Begin VB.Label Label12
- Caption = "体重:"
- Height = 255
- Left = 3000
- TabIndex = 23
- Top = 4320
- Width = 615
- End
- Begin VB.Label Label11
- Caption = "cm"
- Height = 255
- Left = 1680
- TabIndex = 22
- Top = 4320
- Width = 255
- End
- Begin VB.Label Label10
- Caption = "身高:"
- Height = 255
- Left = 240
- TabIndex = 20
- Top = 4320
- Width = 615
- End
- Begin VB.Label Label9
- Caption = "邮编:"
- Height = 255
- Left = 3045
- TabIndex = 18
- Top = 2880
- Width = 735
- End
- Begin VB.Label Label8
- Caption = "系别:"
- Height = 255
- Left = 240
- TabIndex = 16
- Top = 1440
- Width = 615
- End
- Begin VB.Label Label1
- Caption = "学号:"
- Height = 255
- Left = 240
- TabIndex = 14
- Top = 960
- Width = 615
- End
- Begin VB.Label Label7
- Caption = "E-MAIL:"
- Height = 255
- Left = 240
- TabIndex = 10
- Top = 3840
- Width = 735
- End
- Begin VB.Label Label6
- Caption = "地址:"
- Height = 255
- Left = 240
- TabIndex = 9
- Top = 3360
- Width = 615
- End
- Begin VB.Label Label5
- Caption = "电话:"
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 2880
- Width = 615
- End
- Begin VB.Label Label4
- Caption = "籍贯:"
- Height = 255
- Left = 240
- TabIndex = 7
- Top = 2400
- Width = 735
- End
- Begin VB.Label Label3
- Caption = "性别:"
- Height = 255
- Left = 240
- TabIndex = 6
- Top = 1920
- Width = 615
- End
- Begin VB.Label Label2
- Caption = "姓名:"
- Height = 255
- Left = 240
- TabIndex = 5
- Top = 480
- Width = 615
- End
- End
- Begin VB.Data Data1
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = "C:Documents and SettingsbillMy Documents我的数据源通讯录97.mdb"
- DefaultCursorType= 0 '缺省游标
- DefaultType = 2 '使用 ODBC
- Exclusive = 0 'False
- Height = 375
- Left = 2160
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 0 'Table
- RecordSource = "通讯录"
- Top = 3840
- Width = 3135
- End
- End
- Attribute VB_Name = "frmstudent"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdcancel_Click()
- frmmain.Enabled = True
- frmmain.SetFocus
- Unload Me
- End Sub
- Private Sub cmdok_Click()
- Dim fg As Integer
- Set rs = db.OpenRecordset("SELECT * FROM reshi")
- If rs Is Nothing Or rs.Updatable = False Then
- MsgBox "不能打开或写入记录集!"
- Exit Sub
- End If
- rs.AddNew
- DataFile = 1
- If FNAME <> "" Then
- Open FNAME For Binary Access Read As DataFile
- Fl = LOF(DataFile)
- If Fl = 0 Then
- Close DataFile
- Exit Sub
- End If
- block = Fl blocksize
- Fragment = Fl Mod blocksize
- ReDim Chunk(Fragment)
- Get DataFile, , Chunk()
- rs.Fields("photo").AppendChunk Chunk()
- ReDim Chunk(blocksize)
- For I = 1 To block
- Get DataFile, , Chunk()
- rs.Fields("photo").AppendChunk Chunk()
- Next I
- Close DataFile
- End If
- rs.Fields("name") = txtname.Text
- rs.Fields("ID") = txtID.Text
- rs.Fields("profession") = txtdepartment.Text
- rs.Fields("zip") = txtpostcode.Text
- rs.Fields("phone") = txtphone.Text
- rs.Fields("sex") = cmbsex.Text
- rs.Fields("address") = txtaddress.Text
- rs.Fields("height") = Val(txtheight.Text)
- rs.Fields("weight") = Val(txtweight.Text)
- rs.Fields("location") = cmbprovince.Text + cmbcity.Text
- rs.Fields("remark") = txtremark.Text
- rs.Fields("email") = txtemail.Text
- rs.Fields("age") = Val(txtage.Text)
- rs.Fields("flag") = 1
- rs.Update
- rs.Close
- Set rs = Nothing
- fg = MsgBox("信息已录入", vbYesNo)
- If fg = 6 Then
- frmstudent.Enabled = True
- frmstudent.Visible = True
- Else
- Exit Sub
- End If
- End Sub
- Private Sub Form_Load()
- cmbsex.AddItem "男"
- cmbsex.AddItem "女"
- cmbprovince.AddItem "浙江"
- cmbcity.AddItem "慈溪"
- Set db = Workspaces(0).OpenDatabase(App.Path & "reshi.mdb")
- End Sub
- Private Sub Image1_Click()
- flag = 1
- frmloadpic.Visible = True
- frmloadpic.File1.Pattern = "*.bmp;*.jpg;*,ico;*.gif"
- Me.Enabled = False
- End Sub
- Private Sub Label16_Click()
- flag = 1
- frmloadpic.Visible = True
- frmloadpic.File1.Pattern = "*.bmp;*.jpg;*,ico;*.gif"
- Me.Enabled = False
- End Sub
- Private Sub cmbprovince_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- cmbcity.SetFocus
- End If
- End Sub
- Private Sub txtaddress_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtemail.SetFocus
- End If
- End Sub
- Private Sub txtage_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- cmbprovince.SetFocus
- End If
- End Sub
- Private Sub txtdepartment_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- cmbsex.SetFocus
- End If
- End Sub
- Private Sub txtemail_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtheight.SetFocus
- End If
- End Sub
- Private Sub txtheight_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtweight.SetFocus
- End If
- End Sub
- Private Sub txtID_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtdepartment.SetFocus
- End If
- End Sub
- Private Sub cmbsex_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtage.SetFocus
- End If
- End Sub
- Private Sub txtname_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtID.SetFocus
- End If
- End Sub
- Private Sub cmbcity_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtphone.SetFocus
- End If
- End Sub
- Private Sub txtphone_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtpostcode.SetFocus
- End If
- End Sub
- Private Sub txtpostcode_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtaddress.SetFocus
- End If
- End Sub
- Private Sub txtremark_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- cmdok.SetFocus
- End If
- End Sub
- Private Sub txtweight_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- txtremark.SetFocus
- End If
- End Sub