If IsNull(Me.m1) Then
MsgBox ("请输入密码")
Me.m1.SetFocus
Exit Sub
End If
If IsNull(Me.m2) Then
MsgBox ("请再次输入密码")
Me.m2.SetFocus
Exit Sub
End If
If Me.m1 <> Me.m2 Then
MsgBox ("两次输入的密码不一致")
Exit Sub
End If
DoCmd.SetWarnings False
sql = "UPDATE [密码表] set 密码表.密码=me.m1 where 密码表.用户ID=Forms!登录窗![用户ID]"
DoCmd.RunSQL sql
DoCmd.SetWarnings True
DoCmd.Close
MsgBox ("密码更改成功")
End Sub