克服 VBA 输入框字符限制
我当前用来收集文本 InputBox 的函数显然不能接受超过 255 个字符,并且我需要能够收集更多字符?是否可以使用参数或不同的函数来增加此限制?
The current function I use to collect text InputBox can't accept more than 255 characters apparently, and I need to be able to collect more than that? Is there a parameter or different function I can use to increase this limit?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
迂腐一点,输入框允许您输入最多 255 个字符,但它只会返回 254 个字符。
除此之外,是的,您需要创建一个带有文本框的简单表单。然后做一些“辅助函数”,比如:
或者类似的东西......
To be pedantic, the Inputbox will let you type up to 255 characters, but it will only return 254 characters.
Beyond that, yes, you'll need to create a simple form with a textbox. Then just make a little "helper function" something like:
or something like that...
感谢 BradC 提供的信息。我的最终代码大致如下,我有一个按钮,可以调用我创建的表单并将其定位一点,因为我在第一次使用后每次都遇到表单位于错误位置的问题。
用户窗体是一个文本框和两个命令按钮(取消和确定)。按钮的代码如下:
Thanks BradC for the info that. My final code was roughly as follows, I have a button that calls the form that I created and positions it a bit as I was having some issues with the form being in the wrong spot the everytime after the first time I used.
The userform was a TextBox and two CommandButtons(Cancel and Ok). The code for the buttons was as follows:
我没有足够的代表来发表评论,但在助手的子 form_load 中,您可以添加:
在该表单之外,您可以这样做:
当我在工作中从两个额外的监视器中走出来时,我的 Access 表单变得非常混乱我家里有一台额外的显示器,有时会迷失在角落里。这个 AutoCenter 已将其纳入我的每一个表单的表单属性中。
I don't have enough rep to comment, but in the sub form_load for the helper you can add:
Outside of that form, you can do it like this:
My Access forms get all confused when I go from my two extra monitors at work to my one extra monitor at home, and are sometimes lost in the corner. This AutoCenter has made it into the form properties of every one of my forms.