vba 在用户表单之间来回切换
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7768927/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Going Back and forth between Userforms
提问by Russell Saari
Hello everyone on my userfrom I have a previous and a next button the previous button on userform 1 contains a next button which the code looks something like this
大家好我的用户,我有一个上一个和一个下一个按钮用户表单 1 上的上一个按钮包含一个下一个按钮,代码看起来像这样
userform1.hide
userform2.show
on userform 2 I have a previous button that looks like this
在用户表单 2 上,我有一个看起来像这样的上一个按钮
userform2.hide
userform1.show
but when I go back to userform1 and foreward to userform 2 I get an error message that states this.
但是当我回到 userform1 并前进到 userform 2 时,我收到一条错误消息,说明了这一点。
run-time error '400':
运行时错误“400”:
Form already displayed; can't show modally.
表格已显示;不能模态显示。
is there anyway I can fix this or create an if statement to help I am lost right now. Thanks for any help
无论如何我可以解决这个问题或创建一个if语句来帮助我现在迷路了。谢谢你的帮助
采纳答案by ray
Hide first, then show.
先隐,后显。
userform1.Hide
userform2.Show
Also, within the form, you could say ME:
此外,在表格中,您可以说 ME:
Me.Hide
UserForm2.Show
回答by David Pacho
Something like "Multipage" in the toolbox would also be handful here !
工具箱中的“多页”之类的东西在这里也很少见!