在 ms-access 中使用 vba 以编程方式复制表单
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5806201/
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
Copying a form programatically using vba in ms-access
提问by David
I want to programatically copy a form called 'fsubTemplate' to another form called 'fsubInstance' within the same database. I have a good reason for doing this. Is this possible? I'm using ms-access 2007.
我想以编程方式将名为“fsubTemplate”的表单复制到同一数据库中名为“fsubInstance”的另一个表单。我有充分的理由这样做。这可能吗?我正在使用 ms-access 2007。
回答by HansUp
Use the DoCmd.CopyObject Method.
DoCmd.CopyObject , "fsubInstance", acForm, "fsubTemplate"
I didn't supply a value for the first argument, DestinationDatabase, so the destination of the copy will be the current database.
我没有为第一个参数 DestinationDatabase 提供值,因此副本的目的地将是当前数据库。