?? frmedit.frm
字號:
VERSION 5.00
Begin VB.Form frmEdit
Caption = "操作記錄"
ClientHeight = 5700
ClientLeft = 60
ClientTop = 345
ClientWidth = 6660
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5700
ScaleWidth = 6660
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "取消"
Height = 375
Left = 3960
TabIndex = 17
Top = 4920
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "更新"
Height = 375
Left = 2640
TabIndex = 16
Top = 4920
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 375
Left = 1320
TabIndex = 15
Top = 4920
Width = 1095
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 1200
TabIndex = 6
Text = "Text1"
Top = 1200
Width = 1215
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 3960
TabIndex = 5
Text = "Text1"
Top = 1200
Width = 1215
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1200
TabIndex = 4
Text = "Text1"
Top = 2160
Width = 1935
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 3960
TabIndex = 3
Text = "Text1"
Top = 2160
Width = 1215
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 1200
TabIndex = 2
Text = "Text1"
Top = 3000
Width = 1935
End
Begin VB.TextBox Text6
Enabled = 0 'False
Height = 375
Left = 3960
TabIndex = 1
Text = "Text1"
Top = 3000
Width = 1215
End
Begin VB.TextBox Text7
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 0
Text = "Text1"
Top = 3960
Width = 3975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "修改學生的記錄"
BeginProperty Font
Name = "宋體"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 2160
TabIndex = 14
Top = 480
Width = 2535
End
Begin VB.Label Label2
Caption = "學號:"
Height = 255
Left = 600
TabIndex = 13
Top = 1320
Width = 615
End
Begin VB.Label Label3
Caption = "姓名:"
Height = 255
Left = 3240
TabIndex = 12
Top = 1320
Width = 495
End
Begin VB.Label Label4
Caption = "班級:"
Height = 255
Left = 600
TabIndex = 11
Top = 2280
Width = 495
End
Begin VB.Label Label5
Caption = "性別:"
Height = 255
Left = 3360
TabIndex = 10
Top = 2280
Width = 495
End
Begin VB.Label Label6
Caption = "電話:"
Height = 255
Left = 600
TabIndex = 9
Top = 3120
Width = 495
End
Begin VB.Label Label7
Caption = "學分:"
Height = 255
Left = 3360
TabIndex = 8
Top = 3120
Width = 495
End
Begin VB.Label Label8
Caption = "家庭住址:"
Height = 255
Left = 600
TabIndex = 7
Top = 4080
Width = 855
End
End
Attribute VB_Name = "frmEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
frmMain.Data1.Recordset.Edit
frmMain.Data2.Recordset.Edit
Me.Text1.Enabled = True
Me.Text2.Enabled = True
Me.Text3.Enabled = True
Me.Text4.Enabled = True
Me.Text5.Enabled = True
Me.Text6.Enabled = True
Me.Text7.Enabled = True
Me.Command1.Enabled = False
End Sub
Private Sub Command2_Click()
frmMain.Data1.Recordset.Fields("StuId").Value = Me.Text1.Text
frmMain.Data2.Recordset.Fields("StuId").Value = Me.Text1.Text
frmMain.Data1.Recordset.Fields("StuName").Value = Me.Text2.Text
frmMain.Data1.Recordset.Fields("StuClass").Value = Me.Text3.Text
frmMain.Data1.Recordset.Fields("StuSex").Value = Me.Text4.Text
frmMain.Data2.Recordset.Fields("StuPhone").Value = Me.Text5.Text
frmMain.Data1.Recordset.Fields("StuScore").Value = Me.Text6.Text
frmMain.Data2.Recordset.Fields("StuAddress").Value = Me.Text7.Text
frmMain.Data1.Recordset.Update
frmMain.Data2.Recordset.Update
Me.Command2.Enabled = False
MsgBox "修改學生記錄成功!!!", vbOKOnly + vbInformation, "提示..."
frmMain.Data1.Refresh
frmMain.Data2.Refresh
Unload Me
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Text1.Text = frmMain.Data1.Recordset.Fields("StuId").Value
Me.Text2.Text = frmMain.Data1.Recordset.Fields("StuName").Value
Me.Text3.Text = frmMain.Data1.Recordset.Fields("StuClass").Value
Me.Text4.Text = frmMain.Data1.Recordset.Fields("StuSex").Value
Me.Text5.Text = frmMain.Data2.Recordset.Fields("StuPhone").Value
Me.Text6.Text = frmMain.Data1.Recordset.Fields("StuScore").Value
Me.Text7.Text = frmMain.Data2.Recordset.Fields("StuAddress").Value
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -