不了解错误消息 [英] Don't Understand Error Message

查看:91
本文介绍了不了解错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码位于一个名为fAAA的表单的_Click事件中调用的模块中。从ix开始的变量......是Global Long,在其他地方宣布。

This code is in a Module called from an _Click event for my form named fAAA. Variables beginning ix... are Global Long, declared elsewhere.

展开 | 选择 | Wrap | 行号

推荐答案

您好OldBirdman,


发生的事情是2件事情,第一件事就是你在设定的焦点代码行上遇到错误(可能从组合框中返回空值吗?),第二个是您的代码正在终止,因为Resume Next后面的语句是End Sub。


重申:您的代码在第7行遇到错误(SetFocus),然后错误是passe d到错误处理程序。执行错误处理代码,导致执行Stop语句时在第15行暂停程序执行。然后执行resume next,下一个代码行是end sub。
Hi OldBirdman,

What is going on is 2 things, the first is that you are encountering an error on the set focus code line (could there be nulls returned from the combobox?), and the second is that your code is terminating because the statement following Resume Next is End Sub.

To reiterate: Your code is encountering an error on line 7 (SetFocus), then the error is passed to the error handler. The error handling code is executed, resulting in the program execution being halted at line 15 when the Stop statement is executed. Then the resume next is executed , the next code line is the end sub.


如果忽略错误,再次调用子例程,Line#7错误,Debug.Print是
If error is ignored, and subroutine called again, Line #7 errors and the Debug.Print is
展开 | 选择 | Wrap | 行号


感谢您的回复,puppydogbuddy。我之前错过了这个,因为我正在向您的同时添加信息。

Thanks for responding, puppydogbuddy. I missed this earlier as I was adding information with a simultaneous post to yours.


...首先是您在集合上遇到错误焦点代码行
...first is that you are encountering an error on the set focus code line



是的,我同意这一点。

Yes, I would agree with this.


可能有从组合框返回的空值?
could there be nulls returned from the combobox?



否,但即使有,这也是当前表单上的控件的.SetFocus。唯一的原因是它不是Me.cboQuick.SetFocus就是我。只能在类模块中使用。

No, but even if there were, this is a .SetFocus to a control on the current form. The only reason it isn''t Me.cboQuick.SetFocus is Me. can only be used in a Class Module.


...第二个是你的代码终止,因为Resume Next后面的语句是End Sub 。
...and the second is that your code is terminating because the statement following Resume Next is End Sub.



代码执行(至少在步进时)为第4,5,6,7,11,12,13,14,15,16,8,9行。为什么Resume Next,基本上是一个GoTo Line 11如果后面跟着一个End Sub就不会执行?删除第15行仍会显示.DropDown,因此Stop不会影响执行顺序。

The code executes (at least when stepped) as Line 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 8, 9. Why would Resume Next, which is essentially a GoTo Line 11 not execute if followed by an End Sub? Removing Line 15 still displays the .DropDown, so the Stop doesn''t affect the execution order.


导致程序执行在行停止15执行Stop语句时。
resulting in the program execution being halted at line 15 when the Stop statement is executed.



当我说Access关闭时,我不是说代码在停止声明中暂停,我的意思是VBA窗口关闭,所有我打开的表单关闭,数据库窗口关闭,访问窗口关闭,如果我没有打开Windows Internet Explorer,我只会看到我的桌面图像。否你想保存吗? MSGBOX。重新启动Access显示文件列表中的最后一个访问文件不是刚刚关闭的文件。

虽然Access的其余部分没有关闭帮助,但是重新启动计算机需要我输入在应答向导框或索引输入关键字框中。

When I say that Access closes, I don''t mean the code is paused at a Stop Statement, I mean that the VBA Window closes, all my open forms close, the DataBase Window closes, the Access Window closes, and if I didn''t have Windows Internet Explorer open, all I would see is my desktop image. No "Do you want to save?" msgbox. Restarting Access shows that the last access file in the filelist is not the one just closed.
Although Help is not closed with the rest of Access, it will take a computer re-boot to allow me to type in the Answer Wizard boxes or the Index Enter Keyword box.


这篇关于不了解错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆