?? frmstudent.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmstudent
BorderStyle = 1 'Fixed Single
Caption = "學(xué)生信息錄入"
ClientHeight = 7320
ClientLeft = 5250
ClientTop = 690
ClientWidth = 6090
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 7320
ScaleWidth = 6090
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdcancel
Caption = "取消"
Height = 375
Left = 3780
TabIndex = 32
Top = 6825
Width = 975
End
Begin VB.CommandButton cmdok
Caption = "確定"
Height = 375
Left = 1470
TabIndex = 28
Top = 6825
Width = 975
End
Begin VB.Frame Frame1
Caption = "個(gè)人信息"
Height = 6495
Left = 240
TabIndex = 0
Top = 240
Width = 5520
Begin VB.TextBox txtage
Appearance = 0 'Flat
Height = 270
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
Appearance = 0 'Flat
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 = 480
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 = "點(diǎn)擊此處添加照片"
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 = "學(xué)號(hào):"
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 = "G:\大學(xué)人事管理\reshi.mdb"
DefaultCursorType= 0 '缺省游標(biāo)
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 2160
Options = 0
ReadOnly = 0 'False
RecordsetType = 0 'Table
RecordSource = "reshi"
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 mark As Integer
Dim k As Integer
For k = 0 To Data1.Recordset.RecordCount - 1
If txtname.Text = frmsearch.Data1.Recordset.Fields("name") Then
mark = MsgBox("記錄已經(jīng)存在,是否覆蓋?", vbYesNoCancel)
If mark = 6 Then
GoTo fg
End If
If mark = 7 Then
Exit Sub
End If
If mark = 2 Then
Exit Sub
End If
End If
frmsearch.Data1.Recordset.MoveNext
Next k
fg:
Set rs = db.OpenRecordset("SELECT * FROM reshi")
If rs Is Nothing Or rs.Updatable = False Then
MsgBox "不能打開或?qū)懭胗涗浖?quot;
Exit Sub
End If
rs.AddNew
DataFile = 1
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
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
MsgBox "信息已錄入"
End Sub
Private Sub Form_Load()
cmbsex.AddItem "男"
cmbsex.AddItem "女"
cmbprovince.AddItem "浙江"
cmbcity.AddItem "慈溪"
Set db = OpenDatabase("g:\大學(xué)人事管理\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
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -