Private Sub ID_AfterUpdate()
Me.原姓名.Value = DLookup("姓名", "表1", "编号=" & Val(Me.ID))
End Sub
Private Sub 更名_Click()
Dim strsql As String
Dim strname As String
strname = Me.新名字
strsql = "UPDATE 表1 SET 姓名='" & strname & "' WHERE 表1.编号=" & Val(Me.ID)
DoCmd.SetWarnings False
DoCmd.RunSQL strsql
Me.Child2.Form.Requery
End Sub