?? datj.frm
字號:
VERSION 5.00
Begin VB.Form 檔案添加
Caption = "學籍管理-檔案添加"
ClientHeight = 6450
ClientLeft = 60
ClientTop = 450
ClientWidth = 8025
LinkTopic = "Form11"
ScaleHeight = 6450
ScaleWidth = 8025
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame4
Caption = "備注"
Height = 1635
Left = 60
TabIndex = 28
Top = 4770
Width = 7935
Begin VB.TextBox Text13
Height = 1275
Left = 120
TabIndex = 29
Text = "Text13"
Top = 240
Width = 7755
End
End
Begin VB.Frame Frame3
Caption = "住址信息"
Height = 1215
Left = 60
TabIndex = 19
Top = 3510
Width = 7935
Begin VB.TextBox Text12
Height = 315
Left = 960
TabIndex = 27
Text = "Text12"
Top = 780
Width = 6795
End
Begin VB.TextBox Text11
Height = 315
Left = 5700
TabIndex = 25
Text = "Text11"
Top = 240
Width = 2115
End
Begin VB.TextBox Text10
Height = 315
Left = 3300
TabIndex = 23
Text = "Text10"
Top = 240
Width = 1515
End
Begin VB.TextBox Text9
Height = 315
Left = 780
TabIndex = 21
Text = "Text9"
Top = 240
Width = 1515
End
Begin VB.Label Label15
Caption = "家庭住址"
Height = 315
Left = 120
TabIndex = 26
Top = 780
Width = 795
End
Begin VB.Label Label14
Caption = "籍貫"
Height = 315
Left = 5220
TabIndex = 24
Top = 360
Width = 495
End
Begin VB.Label Label13
Caption = "郵編"
Height = 315
Left = 2700
TabIndex = 22
Top = 300
Width = 495
End
Begin VB.Label Label12
Caption = "電話"
Height = 315
Left = 120
TabIndex = 20
Top = 300
Width = 555
End
End
Begin VB.Frame Frame2
Caption = "專業信息"
Height = 1035
Left = 60
TabIndex = 15
Top = 2430
Width = 7935
Begin VB.ComboBox Combo4
Height = 300
Left = 780
Style = 2 'Dropdown List
TabIndex = 34
Top = 630
Width = 2355
End
Begin VB.ComboBox Combo3
Height = 300
Left = 4320
Style = 2 'Dropdown List
TabIndex = 33
Top = 240
Width = 2415
End
Begin VB.ComboBox Combo2
Height = 300
Left = 780
Style = 2 'Dropdown List
TabIndex = 32
Top = 240
Width = 2355
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 315
Left = 7080
TabIndex = 31
Top = 630
Width = 675
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 315
Left = 7080
TabIndex = 30
Top = 240
Width = 675
End
Begin VB.Label Label11
Caption = "班級"
Height = 315
Left = 120
TabIndex = 18
Top = 660
Width = 495
End
Begin VB.Label Label10
Caption = "專業"
Height = 315
Left = 3720
TabIndex = 17
Top = 270
Width = 615
End
Begin VB.Label Label9
Caption = "院系"
Height = 315
Left = 120
TabIndex = 16
Top = 300
Width = 555
End
End
Begin VB.Frame Frame1
Caption = "基本信息"
Height = 1815
Left = 60
TabIndex = 1
Top = 570
Width = 7935
Begin VB.TextBox Text5
Height = 315
Left = 3780
TabIndex = 13
Text = "Text5"
Top = 780
Width = 1095
End
Begin VB.TextBox Text4
Height = 315
Left = 1020
TabIndex = 12
Text = "Text4"
Top = 1320
Width = 1875
End
Begin VB.TextBox Text3
Height = 315
Left = 780
TabIndex = 11
Text = "Text3"
Top = 780
Width = 1935
End
Begin VB.ComboBox Combo1
Height = 300
Left = 6780
Style = 2 'Dropdown List
TabIndex = 10
Top = 300
Width = 975
End
Begin VB.TextBox Text2
Height = 315
Left = 3780
TabIndex = 9
Text = "Text2"
Top = 300
Width = 1815
End
Begin VB.TextBox Text1
Height = 315
Left = 780
TabIndex = 8
Text = "Text1"
Top = 300
Width = 2055
End
Begin VB.Label Label8
Caption = "日期輸入格式:yy,mm,dd"
Height = 315
Left = 3240
TabIndex = 14
Top = 1320
Width = 2325
End
Begin VB.Label Label7
Caption = "血型"
Height = 315
Left = 3120
TabIndex = 7
Top = 840
Width = 555
End
Begin VB.Label Label6
Caption = "出生日期"
Height = 315
Left = 120
TabIndex = 6
Top = 1380
Width = 855
End
Begin VB.Label Label5
Caption = "民族"
Height = 315
Left = 120
TabIndex = 5
Top = 840
Width = 555
End
Begin VB.Label Label4
Caption = "性別"
Height = 315
Left = 6060
TabIndex = 4
Top = 360
Width = 555
End
Begin VB.Label Label3
Caption = "姓名"
Height = 315
Left = 3120
TabIndex = 3
Top = 360
Width = 555
End
Begin VB.Label Label2
Caption = "學號"
Height = 315
Left = 120
TabIndex = 2
Top = 360
Width = 435
End
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "檔 案 添 加"
BeginProperty Font
Name = "黑體"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 60
TabIndex = 0
Top = 60
Width = 7875
End
End
Attribute VB_Name = "檔案添加"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub frmclear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
'Combo1.Style = 2
'Combo2.Style = 2
'Combo3.Style = 2
'Combo4.Style = 2
End Sub
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox " 請輸入學號!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
If Text1.Text = "" Then
MsgBox " 請輸入姓名!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
Exit Sub
End If
Dim yxdm As String
Dim zydm As String
Dim bjdm As String
Dim mrc As ADODB.Recordset
txtsql = "select * from 院系 where 院系名稱='" & Trim(Combo2.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
yxdm = mrc.Fields(0)
mrc.Close
txtsql = "select * from 專業 where 專業名稱='" & Trim(Combo3.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
zydm = mrc.Fields(0)
mrc.Close
txtsql = "select * from 班級 where 班級名稱='" & Trim(Combo4.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
bjdm = mrc.Fields(0)
mrc.Close
txtsql = "select * from 學生基本信息 where 學號='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = False Then
MsgBox " 已經存在該學號!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
Else
mrc.AddNew
mrc.Fields(0) = Text1.Text
mrc.Fields(1) = Text2.Text
mrc.Fields(2) = Combo1.Text
mrc.Fields(3) = Text3.Text
mrc.Fields(4) = Text5.Text
mrc.Fields(5) = DateValue(Text4.Text)
mrc.Fields(6) = yxdm
mrc.Fields(7) = zydm
mrc.Fields(8) = bjdm
mrc.Fields(9) = Text9.Text
mrc.Fields(10) = Text10.Text
mrc.Fields(11) = Text11.Text
mrc.Fields(12) = Text12.Text
mrc.Fields(13) = Text13.Text
mrc.Update
MsgBox " 學生檔案添加成功!", vbExclamation + vbOKOnly, "警告"
mrc.Close
End If
Me.frmclear
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.frmclear
Combo1.AddItem ("男")
Combo1.AddItem ("女")
Dim mrc As ADODB.Recordset
txtsql = "select * from 院系"
Set mrc = ExecuteSQL(txtsql)
Do While Not mrc.EOF
Combo2.AddItem mrc.Fields(1)
mrc.MoveNext
Loop
mrc.Close
txtsql = "select * from 專業"
Set mrc = ExecuteSQL(txtsql)
Do While Not mrc.EOF
Combo3.AddItem mrc.Fields(1)
mrc.MoveNext
Loop
mrc.Close
txtsql = "select * from 班級"
Set mrc = ExecuteSQL(txtsql)
Do While Not mrc.EOF
Combo4.AddItem mrc.Fields(1)
mrc.MoveNext
Loop
mrc.Close
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -