Access 2007不保留表单的窗口大小 [英] Access 2007 not retaining a form's window size

查看:71
本文介绍了Access 2007不保留表单的窗口大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司正在将所有人升级到Access 2007.由于我的机器已经升级,我对Access明显的随机行为感到非常沮丧,我无法理解。它涉及我在Access 2002中创建的数据库(即* .mdb文件)。


当我打开一个边框样式属性设置为''Dialog''的表单时会发生什么,Access 2007正确地保留了表单本身的大小(即如果你在属性框中查看,表单的宽度和高度是正确的)但是Access不记得窗体的大小要显示在窗口中结果我的表单打开得比他们想象的要大得多(几乎占据了Access中的整个工作区),窗体上的所有控件都在窗口的左上角。我将切换到设计视图并重新调整窗口大小,保存表单,一段时间后情况会很好。但几天之后,窗口大小再次爆炸! UG!我有很多人使用我创建的数据库/表单,他们也在抱怨这种行为。


是否有一些新的功能或表单属性Access 2007控制此行为?这是Access 2007的已知错误吗?任何帮助将不胜感激。


谢谢,

sphinney

My company is in the process of upgrading everyone to Access 2007. Since my machine was upgraded I''ve been highly frustrated with an apparent random behaviour byAccess that I can''t understand. It involves databases that I created in Access 2002 (i.e. *.mdb files).

What happens is when I open a form that has the border style property set to ''Dialog'', Access 2007 is correctly preserving the size of the form itself (i.e. if you look in the properties box, the form''s width and height are correct) but Access is not remembering the size of the window the form is to be displayed in. Consequenly my form opens much bigger than they''re supposed to (nearly taking up the entire workspace inside Access) and all of the controls on the form are in the upper left corner of the window. I''ll switch to design view and re-size the window, save the form, and things will be fine for ''a while.'' But then a few days later, the window size blows up again! Ug! I have lots of people you use the databases/forms that I''ve created and they''re complaining about this behaviour, too.

Is there some new fuctionality or form property in Access 2007 that controls this behaviour? Is this a know bug with Access 2007? Any help would be appreciated.

Thanks,
sphinney

推荐答案

最好的我的知识这不是Access 2007中的错误(如果您对转换到Access 2007的错误和问题的参考源感兴趣,请参阅此链接 http://allenbrowne.com/Access2007.html


我也不认为这是主要问题访问窗口;相反,我认为窗口正在调整大小,因为表单正在调整大小。在您尝试以下步骤之前,您无法确切知道:


首先尝试使用简单的建议解决方案:将此代码放在Form'的resize事件中,如图所示,然后测试你的表单:你必须在设计视图中调整表单的大小并在测试之前保存。

To the best of my knowledge this is not a bug in Access 2007 (see this link if you are interested in a reference source for bugs and problems converting to Access 2007 http://allenbrowne.com/Access2007.html )

I also don''t think this is a problem with the main access window; rather I think the window is resizing because the form is resizing. You will not know for sure until you try the steps below:


Try the simple proposed solution first: Place this code in the Form''s resize event as shown, then test your form: You must size your form in design view and save before you test.

展开 | 选择 | Wrap | 行号


感谢您的回复,puppydogbuddy。我尝试了你提供的示例代码,但它没有解决我的问题。我也关闭了MinMaxButtons和ControlBox。也许我没有很好地解释我的问题。


我的问题不在于主要的Access应用程序窗口。相反,它是INSIDE Access与窗体周围的窗口(如果这是有道理的)。当处于表格视图时窗体/窗口打开方式太大。在设计视图中窗口区域内的窗体大小正确,但窗口仍然太大。


我不知道如何在帖子中发布屏幕截图,因为它会说明我的完美的问题。


问题是,即使我调整窗口大小以更紧密地适应表单,在一两天内窗口(没有任何用户参与)调整自身并变为再次太大了。有时窗口甚至比Access工作区更大>


我想弄清楚导致这种行为的原因,更好的是,如何让它停下来!


再次感谢您的帮助。


Thanks for your response, puppydogbuddy. I tried the sample code you provided, but it did not fix my problem. I also aready turned off the MinMaxButtons and the ControlBox. Perhaps I didn''t explain my problem very well.

My issue isn''t with the main Access application window. Rather, it''s INSIDE Access with the window around the form (if that makes any sense) . When in "Form View" the form/window opens way too large. In "Design View" the form inside the window area is the correct size, but the window is still too large.

I''m not sure how to post screen captures in a posting becuase it would illustrate my problem perfectly.

The problem is, even when I resize the window to fit more tightly around the form, in a day or two the window (without any user involvement) resizes itself and becomes way too large again. Sometimes the window is even bigger than the Access workspace>

I''m trying to figure out what causes this behavious and, better yet, how to get it to stop!

Thanks again for your help.



据我所知,这不是一个bug在Access 2007中(如果您对转换到Access 2007的错误和问题的参考源感兴趣,请参阅此链接 http://allenbrowne.com/Access2007.html


我也不认为这是主要访问窗口的问题;相反,我认为窗口正在调整大小,因为表单正在调整大小。在您尝试以下步骤之前,您无法确切知道:


首先尝试使用简单的建议解决方案:将此代码放在Form'的resize事件中,如图所示,然后测试你的表单:你必须在设计视图中调整表单的大小并在测试之前保存。

To the best of my knowledge this is not a bug in Access 2007 (see this link if you are interested in a reference source for bugs and problems converting to Access 2007 http://allenbrowne.com/Access2007.html )

I also don''t think this is a problem with the main access window; rather I think the window is resizing because the form is resizing. You will not know for sure until you try the steps below:


Try the simple proposed solution first: Place this code in the Form''s resize event as shown, then test your form: You must size your form in design view and save before you test.

展开 | 选择 | Wrap | 行号


好的,然后从 www.aadconsulting.com 尝试这个提示

将subfrmtest替换为表单的实际名称。如果它有帮助,请告诉我。


您可以使用Access窗体的InsideHeight和InsideWidth属性在运行时动态调整控件大小。表单'的Resize事件以及当用户调整表单大小时触发,也会在表单加载时触发。


例如,此代码将调整子表单的大小调整大小的形式:


Private Sub Form_Resize()

出错时GoTo ResizeError


''关闭屏幕redraw

Application.Echo False

Me!subfrmTest.Height = Me.InsideHeight -30

Me!subfrmTest.Width = Me.InsideWidth - 30

''重新开启屏幕重绘

Application.Echo False


退出Sub

ResizeError:


''注意:如果发生错误,请重新打开屏幕重绘!

On Error GoTo 0

退出Sub


End Sub
OK, then try this tip from www.aadconsulting.com
Replace subfrmtest with the actual name of your form. Let me know if it helped.

You can use the InsideHeight and InsideWidth properties of an Access form to dynamically resize controls at run-time. A form''s Resize event as well as firing when a user resizes a form, also fires when a form is loaded.

For example, this code will resize a sub-form within a resized form:

Private Sub Form_Resize()
On Error GoTo ResizeError

''Turn off screen redraw
Application.Echo False
Me!subfrmTest.Height = Me.InsideHeight -30
Me!subfrmTest.Width = Me.InsideWidth - 30
''Turn screen redraw back on
Application.Echo False

Exit Sub
ResizeError:

'' NB: Turn screen redraw back on if an error occurs!
On Error GoTo 0
Exit Sub

End Sub


这篇关于Access 2007不保留表单的窗口大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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