谢谢你的帮助,我已经提高了分数,相信非你莫属了,也许是我不知道用法,我也是在OFFICE 2003 ACCESS 中用的,总之让你费心了,能够直接发个已经通过测试的文件给我就好了
自己改了一下,成功了,代码为:
Private Sub 出生日期_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub 身份证号码_AfterUpdate()
On Error GoTo Err_身份证号码_Click
If Len(身份证号码) = 15 Then
xbstr = Right(Trim(身份证号码), 1)
出生日期.Value = Mid(身份证号码, 7, 2) & "-" & Mid(身份证号码, 9, 2) & "-" & Mid(身份证号码, 11, 2)
Else
If Len(身份证号码) = 18 Then
xbstr = Mid(身份证号码, 17, 1)
出生日期.Value = Mid(身份证号码, 7, 4) & "-" & Mid(身份证号码, 11, 2) & "-" & Mid(身份证号码, 13, 2)
Else
MsgBox "身份证数位错误,请检查。", 64, "提醒"
身份证号码.SetFocus
Exit Sub
End If
End If
result = xbstr Mod 2
If result = 0 Then
性别.Value = "女"
Else
性别.Value = "男"
End If
Exit_身份证号码_Click:
Exit Sub
Err_身份证号码_Click:
MsgBox "不能识别的身份证!", 64, "提醒"
Resume Exit_身份证号码_Click
End Sub
Private Sub 主体_Click()
End Sub
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试