Access 2007:使用子表单拆分表单 [英] Access 2007: Split Forms with Subforms

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

问题描述

大家好!这是我在这里的第一篇文章,虽然我已经潜伏在这里好几个月了,并得到了很多帮助。来自过去帖子的提示。


我正在将我们公司的Access 2003数据库更新到2007年,虽然我们发现一些新的特权是整洁的,但我我们有一个问题让他们中的一些人按照我们的设想行事。对于初学者,我们正在使用新的拆分表格功能。当分割表单数据表显示在表单的底部时,它可以从主表单上的另一个子表单/子表单中扩展链接数据(我们的大多数表单都有一个带有多个选项卡的选项卡控件,每个通常包含列表框或子表单)。

我的问题是:
a)是否可以一起启用/禁用该扩展选项,仅显示与之相关的数据主要形式,以及

b)在我们想要使用它的情况下,我们在主窗体上有多个子表单,我们如何选择-which-子表单显示在拆分表格数据表上?它似乎只显示一个链接的数据表,它很少是我们想要的。


感谢您的时间,希望尽可能清楚地说明这一点。


-Lee

Hello all! This is my first posting here, although I''ve been lurking here for months and getting lots of help & tips from the past posts here.

I''m in the process of updating our company''s Access 2003 database to 2007, and while we''re finding some of the new perks to be neat, I''m having a problem getting some of them to behave as we''ve envisioned. For starters, we''re using the new Split Form feature. When the split form datasheet shows up at the bottom of the form, it''s enabled to expand linked data from another subform/subdatasheet that''s on the main form (most of our forms have a tab control with multiple tabs, each usually containing list boxes or subforms).

My question is:
a) is it possible to enable/disable that expansion option alltogether, only showing the data relevant to the main form, and

b) in the case when we want to use it, and we have multiple subforms on a main form, how do we select -which- subform is shown on the split form datasheet? It appears to only show one linked datasheet, and it''s rarely the one we would want.

Thanks for your time guys, hope this was stated as clearly as possible.

-Lee

推荐答案

我现在还有一个完全独立的问题,我需要有人来验证它是否与Split Forms有关。


在我们的表单上,我们在顶部有一个用于跳转到记录号码的组合框(此列表通过各种选项进行过滤,过滤器应用于形式过滤器)。通过这种方式导航记录,所有On Current事件都能正常工作,并且所有表单数据都能正确显示。


但是,如果我使用Split显示的数据表导航到不同的记录在表单视图中,数据在表单字段上保持视觉上准确,但是与On Current事件一起使用的任何计算都使用来自先前记录的旧数据。我已经尝试添加额外的对象重新查询,它在某些情况下有所帮助,但我不想在整个表单上进行额外的重新查询,以使事件正常工作。 = /这是非常令人沮丧的,考虑到所有领域的视觉数据都是正确的。其他人有这个问题吗?每个人都像瘟疫一样避免2007年? ;)


我已经查看了错误列表(allen brownes,microsofts),并没有看到它列在任何地方。


感谢您的时间,


Lee
I now also have a totally separate problem that I need someone to verify if it''s a bug or not with Split Forms.

On our forms, we have a combo box at the top that is used for jumping to record numbers (This list is filtered by a variety of choices, and the filter is applied to the form filter). By navigating records this way, all the On Current events work properly, and all the form data displays correctly.

But, if I navigate to a different record using the datasheet shown with the Split Form view, the data remains visually accurate on the form fields, but any calculations being used with the On Current events are using old data from prior records. I''ve tried adding in extra object requeries, and it helps in some instances, but I dont want to have to do an extra requery on the whole form basically to get the events working properly. =/ It''s very frustrating, considering the correct data is visually in all the fields. Anyone else had any problems with this? Is everyone avoiding 2007 like the plague? ;)

I''ve looked on bug lists (allen brownes, microsofts) and havent seen this listed anywhere.

Thanks for your time,

Lee


好吧已经过了几天因为我发布了这个,没有人回复,我有点期待。


我已经针对这些问题做了一些进一步的测试,特别是我帖子的第二部分中的问题,并且认为我会分享我的发现给任何试图尝试的人在Access 2007中使用拆分表单。希望你能避免我曾经遇到的头痛,或者通过查看此处提出的问题能够比我更好地发现问题。我希望有一个Access 2007的人自己做一些测试,以验证我发现的一些错误。 (或者甚至更好,证明我错了,并指导我去了我误入歧途的地方)


首先,我相信拆分表单功能是真正的错误。如果您的表单设置为拆分,那么当您通过单击数据表更改记录时,或者当您使用表单的导航按钮时,会发生以下错误。

注意:如果关闭拆分表单功能,则记录选择器可正常工作。如果它已经打开,它会继承分割形式数据表所具有的问题。


以下在Form-Current事件期间不起作用,或者与a有关的事件记录#change。 (幸运的是,表单加载事件似乎起作用)


-模块级别的声明变量显示为空

-Combo Box数据显示为null

-Toggle按钮开/关状态需要额外的重新查询

-Toggle按钮标题需要在应用新值之前先清除

-Label标题不能完全改变

-Unbound文本字段需要被重新获取,点击或焦点设置,以显示新应用的值


那是什么我找到了 - 到目前为止。所有问题都与未绑定的数据或控件有关。

现在,我已经设法解决了变量和组合框数据不能正常工作的问题(这是我最大的问题)。幸运的是,就我而言,这些都是在表单加载时设置的,并且在同一用户登录数据库时不会更改。我必须为每个变量制作一个标签,并将其标题设置为我在Load事件期间需要保留的任何属性,然后在Current事件中使用这些标题值。这是一个完全蹩脚的解决方案,但到目前为止,我能够使用新的拆分表单功能升级和使用此数据库的唯一方法。


另外,另一种不同类型的小错误是使用Subform / Subreport控件。首先,如果您使用数据表进行子窗体控制,则可以展开拆分表单数据表以在每行下方显示此子数据。它是一个简洁的功能,允许您进一步过滤此子数据。但是,如果子窗体控件使用的是实际窗体,则会过滤掉过滤,并且在尝试过滤时会出现sql错误。我的解决方法是将查询链接到子窗体控件。通过仅使用查询,拆分表单数据表将展开,并且可以轻松地过滤而不会出现任何问题。


我发布的原始问题仍然存在。如果您有多个子表单,那么我找不到在分割表单数据表中选择那些扩展的那些。
Well it''s been a few days since I''ve posted this, and nobody has replied, which I somewhat expected.

I''ve done some further testing with these problems, specifically the one in the 2nd part of my post, and thought I''d share my findings for anyone else who tries to use split forms in Access 2007. Hopefully you''ll avoid the headaches I''ve had, or be able to identify the problem better than I have by seeing the issues presented here. I''d like for someone with Access 2007 to do some testing on their own to verify some of these bugs I''m finding. (Or even better, prove me wrong and guide me possibly to where I''ve gone astray)

First off, I believe the split form feature to be truly bugged. If your form is set to have a split, then the following bugs happen when you change records via clicking on the datasheet, OR when you use the form''s Navigation Buttons.
Note: the record selector works normally if the Split Form feature is turned back off. If it''s on, it inherits the problems that the split form datasheet has.

The following do NOT work during the Form-Current event, or events that have to do with a record # changing. (Form Load event seems to function, thankfully)

-Declared variables at the module level show up empty
-Combo Box data shows as null
-Toggle button on/off status needs an additional requery
-Toggle button captions need to be cleared first before applying a new value
-Label captions cannot be changed at all
-Unbound text fields need to be requeried, clicked on, or focus set, to display newly applied values

That''s what I''ve found -so far-. All the issues are with unbound data or controls.
Now, I''ve managed a workaround for the variables and combo box data not working (which was my biggest issue). Luckily, in my case, these are all set on form load, and will not change while the same user is logged into the database. I had to make a label for each variable and set it''s caption to whatever property I needed to preserve during the Load event, and then use those caption values in the Current events. It''s a completely lame work-around, but so far the only way I''ve been able to get this database upgraded and working as it had before, using the new split form feature.

Also, another small bug of a different sort, is with Subform/Subreport controls. First off, if you have a subform control using a datasheet, your split form datasheet will be expandable to display this subdata beneath every row. It''s a neat feature, allowing you to further filter on this subdata. But, if the subform control is using an actual form, the filtering is bugged and you''ll get a sql error when trying to filter. My workaround for this, is to link a query to the subform control. By using a query only, the Split Form datasheet will expand, and easily allow you to filter without any problems.

My original problem that I posted about, however, still exists. If you have multiple subforms, there''s no way that I''ve found to select WHICH of those expand in the split form datasheet.


我可以确认标签没有问题更改拆分视图的数据表部分上的记录时更新。使用导航按钮更改记录时,这似乎不是问题。你有没有找到解决方案?我希望使用标签在视觉上警告我的用户有条件的数据。结果我可以改变文本框的属性,但它不具有视觉吸引力。我将尝试创建两个标签,看看我是否可以更改可见性属性,因为forecolor不起作用。
I can confirm the issue with the labels not updating when changing records on the datasheet portion of the split view. This doesn''t seem to be an issue when changing records using the navigation buttons. Have you found a solution to this? I am looking to visually alert my users of conditionally required data using the label. Turns out I can change the properties of the text boxes, but it''s not as visually appealing. I''m going to try creating two labels and see if I can change visibility properties as forecolor doesn''t work.


这篇关于Access 2007:使用子表单拆分表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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