打开儿童表格的数据表 [英] Datasheet to Open Child Form

查看:75
本文介绍了打开儿童表格的数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我在Windows XP操作系统上使用Access 2003。)


本周我必须在我的数据库上提供更新 - 可能在接下来的24小时。这次调查的解决方案或指导真的非常有用! 任何立即的帮助都将不胜感激!


我在数据表视图中有一个子表单(sfrmProjects)。我想双击我的数据表记录,在数据输入模式下打开一个表单(frmViewAllResources)。每当我双击项目并打开这个数据输入表单时,它应为双击项目生成一个新的子记录。


然后,一旦资源关联到一个项目,我想数据表显示+标志,这意味着有一个相关的记录。然后,对于每个子数据表记录,我希望能够通过双击查看(作为只读)并通过切换+双击进行编辑。


上一个帖子中的某个人( http://www.thescripts.com/forum/thread691533.html)确信将数据表更改为连续形式并使用命令按钮。但是,+表示+。关联记录的数据表上的签名功能对我的客户非常有用,因此,如果可以使用数据表完成,那就太棒了。


谢谢!

(I''m using Access 2003 on a Windows XP O/S.)

I''ve gotta present an update on my database this week--possibly within the next 24 hours. A solution or guidance to this inquiry would really, really help! Any immediate assistance would be appreciated!

I have a subform (sfrmProjects) in datasheet view. I''d like to double-click my datasheet records to open up a form (frmViewAllResources) in data entry mode. Every time I double-click on the project and open up this data entry form, it should generate a new subrecord for the double-clicked project.

Then, once a resource is associated to a project, I would like the datasheet to show the "+" sign that means there''s an associated record. Then, for each subdatasheet record, I''d like to be able to view (as read only) by double-clicking on it and edit by maybe shift+double-click.

Someone in a previous thread (http://www.thescripts.com/forum/thread691533.html) was convinced to change the datasheet to a continuous form and use command buttons. However, the "+" sign feature on datasheets for associated records would be extremely useful for my clients, so, if this can be done with datasheets, that would be fantastic.

Thanks!

推荐答案

那里。
  • 关于+

    您可以构建一个返回包含&的文本字段的查询+ QUOT;如果存在FK边表中的相关记录,否则为空。如下所示。

    假设keyProject是这些表链接的字段。
Hi, there.
  • concerning "+"
    You may build a query returning text field containing "+" if related records in FK side table exist, otherwise Null. Like the following.
    Assuming keyProject is the field these tables linked on.
展开 | 选择 | Wrap | 行号


FishVal ,


非常感谢你的快速回复。不幸的是,我和Access一样对待这个论坛,所以,虽然我可以对你的代码有所了解,但我几乎无法形成如何实现它的想法。


ELABORATING ...

表格''两个相应的和相应的表(tblProjects和(tblResources))与由 FiscalYear 组成的连接键相关联, BulkObligation Project 。显然,我希望这些字段从sfrmProjects复制到frmViewAllResources。但是,因为frmViewAllResources是它自己的小怪物控件和制表符,我没有把它作为子窗体嵌入到sfrmProjects中。通常,在处理主窗体和嵌入子窗体时,所有人要做的就是填写记录并点击TAB移动到子窗体和所有相关字段将相应填写。不幸的是,因为我想双击数据表以显示另一个表单,它不一定填写rel自动变换字段。这就是为什么我有数据表,+功能和相关记录问题。


我尝试使用表单向导链接表单。链接表单的默认按钮是切换键。我修改了代码以改为使用双击事件。所以,当我双击像生物燃料这样的项目时,生成的表单(frmViewAllResources)会弹出脏字样。记录。如果我点击另一个项目(环境清理),相同的frmViewAllResources会弹出相同的子记录。所以,实际上,每个项目都与其各自的子记录不匹配。然后,如果我点击一个'为空的项目(即完全空白',因为我还没有填写),frmViewAllResources会弹出一个数据输入表格。


这个概念一般都很好,但我希望当项目实际存在时(即记录很脏),数据条目frmViewAllResources会弹出。只有在资源正确关联后(作为子数据表+记录),我才能将frmViewAllResources弹出为可视(通过双击子数据表记录)或可编辑(通过shift双击子数据表记录) )。


这是我通过表单向导链接表单的childform(frmViewAllResources)代码的一部分:

FishVal,

Thanks so much for your prompt reply. Unfortunately, I''m as new to Access as I am to this forum, so, while I can make some sense of your code, I can barely formulate ideas as to how to implement it.

ELABORATING...
The forms'' two respective and corresponding tables (tblProjects and (tblResources) are related with a concatenated key composed of FiscalYear, BulkObligation, and Project. Obviously, I''d like these fields to copy from "sfrmProjects" over into "frmViewAllResources." However, since frmViewAllResources is its own little monster of controls and tabs, I don''t have it embedded as a subform within sfrmProjects. Usually, when dealing with main forms and embedded subforms, all one has to do is fill in the records and hit TAB to move to the subform and all the related fields will be filled accordingly. Unfortunately, since I want to double-click on the datasheet to bring up another form, it doesn''t necessarily fill in the related fields automatically. That''s why I''m having the datasheet, "+" feature, and related records issues.

I tried using the form wizard to link the forms. The default button to link the forms is a toggle key. I modified the code to use a double-click event instead. So, when I double-click on a Project like "Biofuels," the resulting form (frmViewAllResources) pops up with "dirty" records. If I click on another Project ("Environmental Clean-Up"), the same frmViewAllResources pops up with the same subrecords. So, really, each Project isn''t matching up with its respective subrecords. Then, if I click on a Project that''s null (i.e. is completely blank ''cause I haven''t filled it in), frmViewAllResources pops up as a data entry form.

The concept is generally fine, but I want the data entry frmViewAllResources to pop up when the Project is actually there (i.e. record is dirty). Only after the Resource has been properly associated (as a subdatasheet "+" record) would I like the frmViewAllResources to pop up as viewable (by double-clicking the subdatasheet record) or editable (by shift-double-clicking the subdatasheet record).

This is part of the code I got for the childform (frmViewAllResources) by linking the forms via the form wizard:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


你好,BUSSPU。


让我们把问题分成两部分。
  • 目标1.

    要获取主窗体,一些控件指示记录具有子记录。这可以是带有+的文本框。或复选框。此控件的controlsource将在查询中计算字段 - 表单'的记录源。

    您是否尝试过#2后的建议?如果是,那么你有没有工作?如果您觉得它有些复杂,我很乐意为您提供全面的说明。
  • 目标2.

    打开单独的表单并使其作为嵌入式子表单工作。这通常是通过为表单过滤的字段设置Form.Filter和默认值来完成的。用户的结果将完全像行为一样。
Hi, BUSSPU.

Let''s divide the problem into two parts.
  • Objective 1.
    To get on the main form some control indicating the record has child records. This may be textbox with "+" or checkbox. The controlsource for this control will be calculated field in a query - form''s recordsource.
    Have you tried my suggestion from post#2 ? If yes, then did you''ve got it working? If you feel its somewhat complicated I''d be glad to provide you with comprehensive instructions.
  • Objective 2.
    To open separate form and make it work as embedded subform. That is normally done by setting Form.Filter and default values for the fields the form is filtered by. The result for user will be exactly subform like behaviour.
展开 | 选择 | Wrap | 行号


这篇关于打开儿童表格的数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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