迷失焦点焦点我无法集中注意力 [英] Lost Focus Got Focus I cannot Focus
问题描述
我正在尝试验证表单中的QTY条目,如果用户没有输入任何内容或0,我将提示输入一条消息并且光标返回到QTY条目列。
我在数量上尝试了迷失焦点 -
如果数量< = 0则
msgbox(请输入数量)
me.qty.SetFocus
结束如果
但光标总是跳到下一个输入框,我甚至用Cancel = true替换,它仍然无法工作,任何想法?
我正在尝试验证表单中的QTY条目,如果用户没有输入任何内容或0,我会提示输入一条消息并且光标返回到QTY输入栏。
我在数量上尝试了迷失焦点 -
如果qty< = 0则
msgbox(请输入数量)
me.qty.SetFocus
结束如果
但光标总是跳到下一个输入框,我甚至替换为取消=真,它仍然无法工作,任何想法?
更改为After Update事件。
展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号
但是,如果用户按Tab键或将鼠标移离此文本框,那么我不认为更新后可以检测到它,我是对的吗?
< blockquote class =post_quotes>
但是,如果用户按Tab键或将鼠标移离此文本框,那么我不认为更新后可以检测到它,我是对的吗?
一旦输入控件,它应该触发更新后事件。但是,当然,您只需要在表单OnClose事件中调用该事件。
展开 | 选择 | Wrap | 行号
I am trying to validate a QTY entry in a form , if user did not enter anything or 0 , I will prompt for a message and the cursor return to the QTY entry column.
I have tried Lost Focus in the Qty -
If qty <=0 then
msgbox("Please Enter Qty")
me.qty.SetFocus
end if
But the cursor alway jump to the next entry box, I even replace with Cancel=true, it still doesnt work, Any Idea ?解决方案I am trying to validate a QTY entry in a form , if user did not enter anything or 0 , I will prompt for a message and the cursor return to the QTY entry column.
I have tried Lost Focus in the Qty -
If qty <=0 then
msgbox("Please Enter Qty")
me.qty.SetFocus
end if
But the cursor alway jump to the next entry box, I even replace with Cancel=true, it still doesnt work, Any Idea ?Change to After Update event.
Expand|Select|Wrap|Line Numbers
But what if user press the Tab key or move the mouse away from this text box, then I don''t think After Update could detect it, Am I Right ?
But what if user press the Tab key or move the mouse away from this text box, then I don''t think After Update could detect it, Am I Right ?Once the control has been entered it should trigger the after update event. However, to be sure, you just have to call the event in the forms OnClose event.
Expand|Select|Wrap|Line Numbers
这篇关于迷失焦点焦点我无法集中注意力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆