如何阻止我的vba代码继续用括号括起我的评论? [英] How do I stop my vba code from continuing to surround my comments with parentheses?

查看:68
本文介绍了如何阻止我的vba代码继续用括号括起我的评论?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


这是我第一次发帖,所以我希望能够深入了解我的问题。


我有一个带有注释部分的子表单,当输入注释时,然后选中(失去焦点)标签,代码将括在括号中。这很有效。唯一的问题是,如果再次点击该评论或以其他方式重新聚焦,那么当它被标签关闭或再次失去焦点时,则vba代码用更多括号围绕它。如果我是唯一一个使用这个数据库的人我不会在意,因为我可以轻松地手动避免这个问题,但是还有其他人使用它,并且有评论结束看起来像这样(((((((Vacation( ))))))而不是(休假日)。如果我的价值得到满足,反正有没有阻止我的代码执行。我已经尝试了一些东西,但他们没有解决问题。这就是我的意思当前的VBA代码看起来像。

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

解决方案

展开 | 选择 | Wrap | 行号


哇ADezii。这很完美!我试着解决这个问题。每当我了解更多有关VBA的信息时,我总会提出更多问题。现在我将不得不检查你给我的代码,这样我才能真正理解它是如何工作的,并解决了我的问题。看起来我需要了解替换命令。


非常感谢ADezii。你是一个聪明的人我的朋友。


非常欢迎你,所有修复都应该这么简单! (LOL)

Hello all,

This is my first time posting so I hope I can get some insight into my problem.

I have a subform with a comments section, that, when a comment is entered, and then tabbed off of (loses focus) the code surrounds that statement in parentheses. This is working great. The only problem is that if the that comment is clicked again or is otherwise put back in focus, then when it is tabbed off of or loses focus again, then the vba code surrounds it with more parentheses. If I was the only one using this database I wouldn''t care because I could easily just manually avoid the problem, but there are others who use it, and there comments end of looking something like this (((((((VacationDay)))))) instead of (Vacation Day). Is there anyway to stop my code from executing if my value is met. I''ve tried a few things but they aren''t solving the problem. This is what my current VBA code looks like.

Expand|Select|Wrap|Line Numbers

解决方案

Expand|Select|Wrap|Line Numbers


Wow ADezii. That worked perfectly! I was going nuts trying to solve that. Everytime I learn more about VBA I always come out with more questions lol. Now I''m going to have to examine the code you gave me, so I can truly understand how it worked and solved my problem. Looks like I need to learn about replace commands.

Thanks so much ADezii. You are a brilliant man my friend.


You are quite welcome, all fixes should be so easy! (LOL)


这篇关于如何阻止我的vba代码继续用括号括起我的评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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