If e.Col.Name = "课时" Then '如果编辑的是课时列 Dim pwd As String InputPassWord(pwd,"验证","请输入密码") '输入密码 If pwd = e.Row("学员密码") Then '如果密码正确 Forms("学员上课").Open() Dim nr As Row = Tables("表B").AddNew() nr("用户名") = e.Row("用户名") Else Messagebox.Show("密码错误","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Forms("学员上课").Close End If End If