frmteacher.frm
上传用户:plkplk66
上传日期:2007-06-06
资源大小:686k
文件大小:12k
源码类别:

其他行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form frmteacher 
  3.    Caption         =   "教师信息录入"
  4.    ClientHeight    =   7395
  5.    ClientLeft      =   5265
  6.    ClientTop       =   945
  7.    ClientWidth     =   6240
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   7395
  10.    ScaleWidth      =   6240
  11.    StartUpPosition =   2  '屏幕中心
  12.    Begin VB.Frame frteacher 
  13.       Caption         =   "教师信息"
  14.       Height          =   6435
  15.       Left            =   315
  16.       TabIndex        =   2
  17.       Top             =   210
  18.       Width           =   5640
  19.       Begin VB.ComboBox cmbdate 
  20.          Appearance      =   0  'Flat
  21.          Height          =   300
  22.          Left            =   2625
  23.          TabIndex        =   33
  24.          Top             =   1365
  25.          Width           =   645
  26.       End
  27.       Begin VB.ComboBox cmbmonth 
  28.          Appearance      =   0  'Flat
  29.          Height          =   300
  30.          Left            =   1785
  31.          TabIndex        =   32
  32.          Top             =   1365
  33.          Width           =   645
  34.       End
  35.       Begin VB.ComboBox cmbyear 
  36.          Appearance      =   0  'Flat
  37.          Height          =   300
  38.          Left            =   840
  39.          TabIndex        =   31
  40.          Top             =   1365
  41.          Width           =   645
  42.       End
  43.       Begin VB.ComboBox cmbsex 
  44.          Appearance      =   0  'Flat
  45.          Height          =   300
  46.          Left            =   840
  47.          TabIndex        =   30
  48.          Text            =   "男"
  49.          Top             =   945
  50.          Width           =   645
  51.       End
  52.       Begin VB.TextBox txtphone 
  53.          Appearance      =   0  'Flat
  54.          Height          =   270
  55.          Left            =   1155
  56.          TabIndex        =   13
  57.          Top             =   1785
  58.          Width           =   960
  59.       End
  60.       Begin VB.TextBox txtaddress 
  61.          Appearance      =   0  'Flat
  62.          Height          =   270
  63.          Left            =   1155
  64.          TabIndex        =   12
  65.          Top             =   2625
  66.          Width           =   4170
  67.       End
  68.       Begin VB.TextBox txtpostcode 
  69.          Appearance      =   0  'Flat
  70.          Height          =   270
  71.          Left            =   1155
  72.          TabIndex        =   11
  73.          Top             =   2205
  74.          Width           =   960
  75.       End
  76.       Begin VB.TextBox txtID 
  77.          Appearance      =   0  'Flat
  78.          Height          =   270
  79.          Left            =   735
  80.          TabIndex        =   10
  81.          Top             =   4095
  82.          Width           =   1275
  83.       End
  84.       Begin VB.TextBox txtworktime 
  85.          Appearance      =   0  'Flat
  86.          Height          =   270
  87.          Left            =   2625
  88.          TabIndex        =   9
  89.          Top             =   4095
  90.          Width           =   330
  91.       End
  92.       Begin VB.TextBox txtpro 
  93.          Appearance      =   0  'Flat
  94.          Height          =   270
  95.          Left            =   4095
  96.          TabIndex        =   8
  97.          Top             =   4095
  98.          Width           =   1275
  99.       End
  100.       Begin VB.ComboBox cmbmarriage 
  101.          Appearance      =   0  'Flat
  102.          Height          =   300
  103.          Left            =   2310
  104.          TabIndex        =   7
  105.          Text            =   "是"
  106.          Top             =   945
  107.          Width           =   615
  108.       End
  109.       Begin VB.Frame Frame1 
  110.          Caption         =   "备注"
  111.          Height          =   1695
  112.          Left            =   210
  113.          TabIndex        =   5
  114.          Top             =   4515
  115.          Width           =   5160
  116.          Begin VB.TextBox Text5 
  117.             Appearance      =   0  'Flat
  118.             Height          =   1380
  119.             Left            =   105
  120.             MultiLine       =   -1  'True
  121.             ScrollBars      =   2  'Vertical
  122.             TabIndex        =   6
  123.             Text            =   "frmteacher.frx":0000
  124.             Top             =   210
  125.             Width           =   4950
  126.          End
  127.       End
  128.       Begin VB.TextBox txtname 
  129.          Appearance      =   0  'Flat
  130.          Height          =   270
  131.          Left            =   840
  132.          TabIndex        =   4
  133.          Top             =   525
  134.          Width           =   960
  135.       End
  136.       Begin VB.TextBox txtemail 
  137.          Appearance      =   0  'Flat
  138.          Height          =   270
  139.          Left            =   840
  140.          TabIndex        =   3
  141.          Top             =   3150
  142.          Width           =   4530
  143.       End
  144.       Begin VB.Label Label1 
  145.          Caption         =   "姓名:"
  146.          Height          =   210
  147.          Index           =   0
  148.          Left            =   210
  149.          TabIndex        =   29
  150.          Top             =   630
  151.          Width           =   615
  152.       End
  153.       Begin VB.Label Label2 
  154.          Caption         =   "性别:"
  155.          Height          =   255
  156.          Left            =   210
  157.          TabIndex        =   28
  158.          Top             =   1050
  159.          Width           =   615
  160.       End
  161.       Begin VB.Label Label3 
  162.          Caption         =   "生日:"
  163.          Height          =   255
  164.          Left            =   210
  165.          TabIndex        =   27
  166.          Top             =   1470
  167.          Width           =   615
  168.       End
  169.       Begin VB.Image Image1 
  170.          BorderStyle     =   1  'Fixed Single
  171.          Height          =   1755
  172.          Left            =   3990
  173.          Stretch         =   -1  'True
  174.          Top             =   525
  175.          Width           =   1320
  176.       End
  177.       Begin VB.Label Label4 
  178.          Caption         =   "联系电话:"
  179.          Height          =   255
  180.          Left            =   210
  181.          TabIndex        =   26
  182.          Top             =   1890
  183.          Width           =   975
  184.       End
  185.       Begin VB.Label Label5 
  186.          Caption         =   "家庭地址:"
  187.          Height          =   255
  188.          Left            =   210
  189.          TabIndex        =   25
  190.          Top             =   2730
  191.          Width           =   975
  192.       End
  193.       Begin VB.Label Label6 
  194.          Caption         =   "邮    编:"
  195.          Height          =   150
  196.          Left            =   210
  197.          TabIndex        =   24
  198.          Top             =   2310
  199.          Width           =   930
  200.       End
  201.       Begin VB.Line Line1 
  202.          BorderColor     =   &H80000010&
  203.          BorderWidth     =   2
  204.          X1              =   210
  205.          X2              =   5355
  206.          Y1              =   3780
  207.          Y2              =   3780
  208.       End
  209.       Begin VB.Label Label7 
  210.          Caption         =   "点击此处添加照片"
  211.          Height          =   540
  212.          Left            =   4305
  213.          TabIndex        =   23
  214.          Top             =   1155
  215.          Width           =   750
  216.       End
  217.       Begin VB.Label Label8 
  218.          Caption         =   "年"
  219.          Height          =   225
  220.          Left            =   1575
  221.          TabIndex        =   22
  222.          Top             =   1470
  223.          Width           =   225
  224.       End
  225.       Begin VB.Label Label9 
  226.          Caption         =   "月"
  227.          Height          =   225
  228.          Left            =   2415
  229.          TabIndex        =   21
  230.          Top             =   1470
  231.          Width           =   225
  232.       End
  233.       Begin VB.Label Label10 
  234.          Caption         =   "日"
  235.          Height          =   225
  236.          Left            =   3255
  237.          TabIndex        =   20
  238.          Top             =   1470
  239.          Width           =   225
  240.       End
  241.       Begin VB.Label Label11 
  242.          Caption         =   "工号:"
  243.          Height          =   225
  244.          Left            =   210
  245.          TabIndex        =   19
  246.          Top             =   4200
  247.          Width           =   540
  248.       End
  249.       Begin VB.Label Label12 
  250.          Caption         =   "工龄:"
  251.          Height          =   225
  252.          Left            =   2100
  253.          TabIndex        =   18
  254.          Top             =   4200
  255.          Width           =   540
  256.       End
  257.       Begin VB.Label Label13 
  258.          Caption         =   "年"
  259.          Height          =   225
  260.          Left            =   3045
  261.          TabIndex        =   17
  262.          Top             =   4200
  263.          Width           =   225
  264.       End
  265.       Begin VB.Label Label14 
  266.          Caption         =   "专业:"
  267.          Height          =   225
  268.          Left            =   3570
  269.          TabIndex        =   16
  270.          Top             =   4200
  271.          Width           =   540
  272.       End
  273.       Begin VB.Label Label15 
  274.          Caption         =   "婚否:"
  275.          Height          =   225
  276.          Left            =   1680
  277.          TabIndex        =   15
  278.          Top             =   1050
  279.          Width           =   540
  280.       End
  281.       Begin VB.Label Label16 
  282.          Caption         =   "email:"
  283.          Height          =   225
  284.          Left            =   210
  285.          TabIndex        =   14
  286.          Top             =   3255
  287.          Width           =   750
  288.       End
  289.    End
  290.    Begin VB.CommandButton Command3 
  291.       Caption         =   "退出"
  292.       Height          =   330
  293.       Left            =   3585
  294.       TabIndex        =   1
  295.       Top             =   6825
  296.       Width           =   855
  297.    End
  298.    Begin VB.CommandButton Command1 
  299.       Caption         =   "确定"
  300.       Height          =   330
  301.       Left            =   1800
  302.       TabIndex        =   0
  303.       Top             =   6825
  304.       Width           =   855
  305.    End
  306. End
  307. Attribute VB_Name = "frmteacher"
  308. Attribute VB_GlobalNameSpace = False
  309. Attribute VB_Creatable = False
  310. Attribute VB_PredeclaredId = True
  311. Attribute VB_Exposed = False
  312. Option Explicit
  313. Private Sub Command1_Click()
  314. Set rs = db.OpenRecordset("SELECT * FROM reshi")
  315. If rs Is Nothing Or rs.Updatable = False Then
  316.    MsgBox "不能打开或写入记录集!"
  317.    Exit Sub
  318. End If
  319. rs.AddNew
  320. DataFile = 1
  321. If FNAME <> "" Then
  322. Open FNAME For Binary Access Read As DataFile
  323. Fl = LOF(DataFile)
  324.  If Fl = 0 Then
  325.         Close DataFile
  326.         Exit Sub
  327.     End If
  328.         block = Fl  blocksize
  329.     Fragment = Fl Mod blocksize
  330.     ReDim Chunk(Fragment)
  331.     Get DataFile, , Chunk()
  332.     rs.Fields("photo").AppendChunk Chunk()
  333.     ReDim Chunk(blocksize)
  334.     For I = 1 To block
  335.         Get DataFile, , Chunk()
  336.         rs.Fields("photo").AppendChunk Chunk()
  337.     Next I
  338. Close DataFile
  339. End If
  340. rs.Fields("name") = txtname.Text
  341. rs.Fields("ID") = txtID.Text
  342. rs.Fields("zip") = txtpostcode.Text
  343. rs.Fields("phone") = txtphone.Text
  344. rs.Fields("sex") = cmbsex.Text
  345. rs.Fields("address") = txtaddress.Text
  346. rs.Fields("worktime") = Val(txtworktime.Text)
  347. rs.Fields("profession") = txtpro.Text
  348. rs.Fields("marriage") = cmbmarriage.Text
  349. rs.Fields("remark") = Text5.Text
  350. rs.Fields("email") = txtemail.Text
  351. rs.Fields("birth") = cmbyear.Text + "年" + cmbmonth + "月" + cmbdate + "日"
  352. rs.Fields("flag") = 0
  353. rs.Update
  354. rs.Close
  355. Set rs = Nothing
  356. MsgBox "信息已录入"
  357. End Sub
  358. Private Sub Command3_Click()
  359. frmmain.SetFocus
  360. Unload Me
  361. End Sub
  362. Private Sub Form_Load()
  363. cmbsex.AddItem "男"
  364. cmbsex.AddItem "女"
  365. cmbyear.AddItem "1981"
  366. cmbmonth.AddItem "1"
  367. cmbmonth.AddItem "2"
  368. cmbmonth.AddItem "3"
  369. cmbmonth.AddItem "4"
  370. cmbmonth.AddItem "5"
  371. cmbmonth.AddItem "6"
  372. cmbmonth.AddItem "7"
  373. cmbmonth.AddItem "8"
  374. cmbmonth.AddItem "9"
  375. cmbmonth.AddItem "10"
  376. cmbmonth.AddItem "11"
  377. cmbmonth.AddItem "12"
  378. cmbdate.AddItem "1"
  379. cmbdate.AddItem "2"
  380. cmbdate.AddItem "3"
  381. cmbdate.AddItem "4"
  382. cmbdate.AddItem "5"
  383. cmbdate.AddItem "6"
  384. cmbdate.AddItem "7"
  385. cmbdate.AddItem "8"
  386. cmbdate.AddItem "9"
  387. cmbdate.AddItem "10"
  388. cmbdate.AddItem "11"
  389. cmbdate.AddItem "12"
  390. cmbdate.AddItem "13"
  391. cmbdate.AddItem "14"
  392. cmbdate.AddItem "15"
  393. cmbdate.AddItem "16"
  394. cmbdate.AddItem "17"
  395. cmbdate.AddItem "18"
  396. cmbdate.AddItem "19"
  397. cmbdate.AddItem "20"
  398. cmbdate.AddItem "21"
  399. cmbdate.AddItem "22"
  400. cmbdate.AddItem "23"
  401. cmbdate.AddItem "24"
  402. cmbdate.AddItem "25"
  403. cmbdate.AddItem "26"
  404. cmbdate.AddItem "27"
  405. cmbdate.AddItem "28"
  406. cmbdate.AddItem "29"
  407. cmbdate.AddItem "30"
  408. cmbdate.AddItem "31"
  409. cmbmarriage.AddItem "是"
  410. cmbmarriage.AddItem "否"
  411. Set db = Workspaces(0).OpenDatabase(App.Path & "reshi.mdb")
  412. End Sub
  413. Private Sub Image1_Click()
  414. flag = 0
  415. frmloadpic.Visible = True
  416. frmloadpic.File1.Pattern = "*.bmp;*.jpg;*,ico;*.gif"
  417. Me.Enabled = False
  418. End Sub
  419. Private Sub Label7_Click()
  420. flag = 0
  421. frmloadpic.Visible = True
  422. frmloadpic.File1.Pattern = "*.bmp;*.jpg;*,ico;*.gif"
  423. Me.Enabled = False
  424. End Sub