VBA不工作 - 全部 [英] VBA Not Working -- AT ALL

查看:82
本文介绍了VBA不工作 - 全部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,专家,这是迄今为止我遇到的MS Access最奇怪的事情......我看到了一些非常奇怪的东西。


我在这里,一起工作并建立一个新的数据库,建立了一些表格,设计了一个报告,精心设计了几种形式 - 在我开始编写代码之前,先将外观和感觉放在首位。


然后我起草一些快速代码来执行一个非常简单的功能 - 没什么特别的,只是在记录集中快速的一点练习。所以,我打开表单,单击我的命令按钮......没什么。


什么?也许我没有命令按钮或命名正确的程序。不,点击事件启动器,我的代码就在哪里!


让我在程序名称处插入一个断点。也许程序正在解雇,但只是没有做。任何东西。这不是我第一次编写错误的代码。


打开表单并单击按钮....没什么!甚至不突出程序!什么都没有。


嗯,也许这个可能有问题。数据库,但它是全新的 - 只有几个小时的工作。但是,让我创建一个更新的db并导入我的所有对象。


打开表单,单击按钮。 没什么 !!! ???


所以,我想弄明白这一点。我检查了我一直使用的DB的设置。一切都是一样的。


我点击我的访问选项,在当前数据库下,我有使用访问特殊密钥。选中。我不想让人们滥用数据库,所以我禁用了这个功能(就像我目前工作的所有其他数据库一样!)。嗯,我检查一下,关闭数据库并再次打开它。


打开表格,点击按钮,然后 BAM !奇迹般有效。再次打开我的访问选项, un 选中使用访问特殊密钥框,关闭数据库并再次打开它。


打开表单,单击按钮,然后 BAM !就像一个魅力!!!


我自由地承认我不知道关于Access的一切,但这个远远超出了 BIZARRE 我必须分享,看看 任何人 对此有何见解?


是的!有一个原因让Goofy在这个问题上摸不着头......

OK, experts, here is the weirdest thing I have ever experienced with MS Access so far... and I''ve seen some really weird stuff.

Here I am, working along and building a new database, got a few tables built, designed a report, crafted a few forms--getting the look and feel right first, before I start writing the code.

Then I draft some quick code to perform a very simple function--nothing fancy, just a quick little exercise in recordsets. So, I open the form, click my command button and.... nothing.

What? Maybe I don''t have the command button or the procedure named properly. Nope, click on the event launcher and it takes right to where my code is!

Let me insert a break point at the name of the procedure. maybe the procedure is firing, but just not "doing" anything. This wouldn''t be the first time that I''ve written faulty code.

Open the form and click the button.... Nothing! Doesn''t even highlight the procedure! Nothing.

Hmmmmm, maybe there is something wrong with "this" DB, but it is brand new--only a couple hours of work. But, let me create a "newer" db and import all my objects.

Open the Form, click the button. NOTHING!!!???

So, I''m trying to figure this out. I check the setting of the DB''s I use all the time. Everything is identical.

I click on my Access Options, and under Current Database, I have the "Use Access Special Keys" unchecked. I don''t like to let people misuse the DB, so I disable this feature (just like on all my other DBs that currently work!). Hmmmmmmm, I check it, close the DB and open it again.

Open the Form, click the button, and BAM! Works like a charm. Open my Access Options again, uncheck the "Use Access Special Keys" box, close the DB and open it again.

Open the Form, click the button, and BAM! Works like a charm!!!

I freely admit that I don''t know everything about Access, but this one is so far beyond absolutely BIZARRE that I had to share to see if anyone has any insights into this?

Yeah! There is a reason why Goofy is scratching his head on this one.....

推荐答案

当代码对我不起作用时,我通常会想到的是是数据库首次打开时我没有启用内容。如果数据库不在受信任的位置,那么它(默认情况下)将打开数据库并禁用宏和代码。你必须点击启用内容才能工作。
When code doesn''t work for me, what I normally think of is that I haven''t enabled content when the database first opens. If the database isn''t in a trusted location, then it will (by default anyway) open the database with macros and code disabled. You would have to click Enable Content to it to work.


是的 - 完成了。我得到的那个巨大的黄色警告标志很难错过....


这是我见过的最疯狂的东西。
Yep - done that. That humongous yellow warning sign that I get is kind of hard to miss....

This one was the craziest thing I''ve ever seen.

哪个版本的Twinnyfo?


似乎从一开始就禁用特殊密钥这一事实使其进入某种模式,代码无法正常工作。


如果你能分享,我会对你要播放的副本感兴趣。如果有帮助,我可以让你的电子邮件地址没问题。
Which version Twinnyfo?

Seems like the fact of disabling Special Keys from the start gets it into some mode whereby the code doesn''t work.

I''d be interested in a copy to play with if you can share. I can let you have my email address no problem if that helps.


这篇关于VBA不工作 - 全部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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