Office中国论坛/Access中国论坛

标题: 关于弹出提示框的问题 [打印本页]

作者: jy00781671    时间: 2010-12-6 19:34
标题: 关于弹出提示框的问题
当文本框使用者准备填写下个文本框,但list值为空的的时候,弹出窗体message,如果不用宏,代码应该是怎么样,求教各位。[attach]44309[/attach]

作者: li08hua    时间: 2010-12-6 21:56
If Me.List0 = "" Then
    DoCmd.OpenForm "message"
  End If
作者: jy00781671    时间: 2010-12-6 22:22
回复 li08hua 的帖子

谢谢如果改下条件长度不为8,那么表达式是Length(list0)<>8是这样么


作者: li08hua    时间: 2010-12-6 22:34
看不懂你的Length是什么,如果list0是字符串,Me.List0<>Len(8)
作者: lurong    时间: 2010-12-6 22:52
本帖最后由 lurong 于 2010-12-6 23:02 编辑

[attach]44312[/attach]关于窗口提示,试试这个!

作者: li08hua    时间: 2010-12-7 00:27
才发觉,更正一下,代码写反了,应为:Len(Me.List0)<>8
作者: roych    时间: 2010-12-7 01:21
在Test2里写上获取焦点事件:
Private Sub Text2_GotFocus()
If IsNull(Me.List0) Or Len(Me.List0) <> 8 Then
DoCmd.OpenForm "message"
Me.List0.SetFocus
End If
End Sub
试试看?
[attach]44316[/attach]

作者: jy00781671    时间: 2010-12-7 18:09
谢谢各位的详细解释,我每个试了一遍发现都可以运行。谢谢帮助
作者: szyuer    时间: 2010-12-8 17:12
看不太明白,,,
作者: leomen    时间: 2010-12-21 20:56
ghfhffh




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3