|
请教:运行过程中出现:"无效使用Null"提示,请大侠帮我看一下问题出在哪里哟?
我是新手刚学使用ACCESS哟!
Option Compare Database
Option Explicit
Public YHMC As String
Public SRYHMC As String
Public SRYHMM As String
Public SRMMTS As String
Public SRMMDA As String
Private Sub 确认_Click()
On Error GoTo Error_确认_Click
SRYHMC = " "
SRYHMM = " "
SRMMTS = " "
SRMMDA = " "
If IsNull(Me![用户名称]) Then
MsgBox "请输入用户名称!", vbExclamation, "输入用户名称"
Me![用户密码].SetFocus
ElseIf IsNull(Me![用户密码]) Then
MsgBox "请输入用户密码!", vbExclamation, "输入用户密码"
Me![用户密码].SetFocus
ElseIf IsNull(Me![确认密码]) Then
MsgBox "请输入确认密码!", vbExclamation, "输入确认密码"
Me![确认密码].SetFocus
ElseIf Len(Me![用户密码]) > 8 Or Len(Me![确认密码]) > 8 Then
MsgBox "您输入用户密码或者确认密码太长,最多可以输入8个字符!", vbExclamation, "密码太长"
Me![用户密码] = " "
Me![确认密码] = " "
Me![用户密码].SetFocus
ElseIf Trim(Me![用户密码]) <> Trim(Me![确认密码]) Then
MsgBox "您输入用户密码和确认密码不一致,请重新输入!", vbExclamation, "两次密码不一致"
Me![用户密码] = " "
Me![确认密码] = " "
Me![用户密码].SetFocus
Else
SRYHMC = Me![用户名称]
SRYHMM = Me![用户密码]
SRMMTS = Me![密码提示]
SRMMDA = Me![密码答案]
DoCmd.Close
DoCmd.OpenForm "面板 011用户注册", acNormal, , , , acWindowNormal
End If
Exit_确认_Click:
Exit Sub
Error_确认_Click:
MsgBox Err.Description
Resume Exit_确认_Click
End Sub |
|