调整表单大小 [英] Resizing Forms

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

问题描述

哇梅丽莎你听起来很忙哈哈。


你能解释一下如何级联更新和删除吗?无论表格/子表格如何显示,这听起来都是不错的做法!



在主数据库窗口中单击工具 - 从那里的关系添加你的表创建关系并将其设置为参照完整性然后设置级联更新和删除。这应该采取关心核心记录的任何问题。如果你想要,你可以禁用主窗体上的每个控件,但这是你可能考虑的唯一的其他东西。你需要一些方法来退出子窗体并启用所有控件,所以在你尝试以下之前要考虑一下:


Dim ctl As Control

For每个ctl In frm.Controls

如果不是ctl.ControlType = 122那么

ctl.Enabled = false

结束如果

下一页


为了调整子表单的大小我使用以下内容并且效果很好...

展开 | 选择 | Wrap | 行号

解决方案

感谢Denburt的回复!


其实我确实知道在创建表关系图时我已经设置了级联。 :-)


我是一个Access noob,用VB不太好。你有机会解释一下你的代码吗?特别是我需要为自己的代码更改的内容? :-D


我想这一行例如:

展开 | 选择 | Wrap | 行号


数字是指距离主要边缘(侧面和底部)的距离,即使旁边没有任何东西,我也希望留下一点间隙。如果您在子窗体旁边或下面有一个控件,您可能需要更多距离。我想补充说,它旁边或下面的任何东西都需要移动,因此子窗体的大小调整不会重叠。

展开 | 选择 < span class =codeDivider> | Wrap | 行号


我应该补充一点,VBA中的度量单位是Twips。


twip:测量单位,等于点的1/20,或1 / 1,440英寸。一厘米有567个缇。


Wow Melissa you sound busy lol.

Can you explain about how to cascade updates and deletes? That sounds like good practice regardless of how the forms/subforms are displayed!

In the main Database window click on tools - relationships from there add your tables create the relationship and set it to referential integrity then set cascade update and deletes.That should take care of any problems with corelating the records. If you want you can disable each control that is on the main form but that is about the only other thing you might consider. You will need some way to exit the subform and enable all the controls also so think about that before you attempt the following:

Dim ctl As Control
For Each ctl In frm.Controls
If not ctl.ControlType = 122 Then
ctl.Enabled = false
end if
Next

For resizing subforms I use the following and it works pretty good...

Expand|Select|Wrap|Line Numbers

解决方案

Thanks for the reply Denburt!

Actually I did figure out that I had the cascading already set when I created my table relationships diagram. :-)

I''m an Access noob and not very good with VB. Any chance you could explain your code a bit? Particularly the things I need to change for my own code? :-D

I imagine this line for example:

Expand|Select|Wrap|Line Numbers


The numbers refer to the distance from the edge of your main form (side and bottom), I like to leave a little gap even if nothing is next to it. If you have a control beside or below the subform you may want more distance. I would like to add that anything beside or below it will need to be moved as well so the resizing of the subform doesn''t overlap.

Expand|Select|Wrap|Line Numbers


I should probably have added that the unit of measurement in VBA is Twips.

twip: Unit of measurement that is equal to 1/20 of a point, or 1/1,440 of an inch. There are 567 twips in a centimeter.


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

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