MS-访问:如何在相同的位置/大小打开窗体作为封闭/ previous形式? [英] MS-Access: How to open form in same location/size as closed/previous form?

查看:427
本文介绍了MS-访问:如何在相同的位置/大小打开窗体作为封闭/ previous形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Access 2003将运行作为一个独立的应用程序(即使用Access运行时)创建数据库应用程序。我有打开一个pre定义的位置和大小的主要形式,我想控制,其中任何其他形式的公开。

I am creating a database application using Access 2003 that will be run as a stand-alone application (i.e. using the Access runtime). I have a main form that opens to a pre-defined location and size and I would like to control where any other forms open.

我想在相同的位置和大小为主要形式打开其他形式。我可以使用自动居中属性,但我希望用户能够移动无论他们喜欢的形式,并有新的形式出现在那个位置。只有一种形式将在任何一个时间开,因为我打开一个新的表单时关闭previous形式。

I would like to open additional forms at the same location and size as the main form. I could use the "autocenter" property but I would like the user to be able to move the form wherever they like and have the new form appear at that location. Only one form will be open at any one time since I close the previous form when opening a new form.

这是如何做到这一点与VBA有什么建议?谢谢你。

Any suggestions on how to accomplish this with VBA? Thanks.

推荐答案

您可以阅读形式的属性值来确定第一个窗体的位置和大小。

You can read form property values to determine the first form's position and size.

Debug.Print Me.WindowLeft, Me.WindowTop, Me.WindowWidth, Me.WindowHeight

接下来的表单可以用Move方法匹配的值。

The next form can match those values with the Move method.

Me.Move Left:=0, Top:=0, Width:=400, Height:=300

您必须决定上的方法,以从所述第一值传递给第二个形式。

You would have to decide on a method to pass the values from the first to the second form.

  1. 为自定义类的属性
  2. 作为OpenArgs对于第二种形式
  3. 使用一个表来存储的值

这篇关于MS-访问:如何在相同的位置/大小打开窗体作为封闭/ previous形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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