表单复选框对应于表条目 [英] form checkboxes correspond to table entry

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

问题描述

好的,这里有,

我有3张桌子


[人员表]

Person_ID:正文;

first_name:text;

last_name:text;


[Group_Definition Table]

Group_ID ;自动编号;

Group_Desc:文字;


[Person_Group_Membership]

person_id:text;

Group_ID ;数字;


样本数据


[人员表]

aaaa Jim Johnson

bbbb Joe Jones

cccc John Doe


[Group_Definition Table]

1 GroupA

2 GroupB

3 GroupC


[Person_Group_Membership]

aaaa 1

bbbb 1

aaaa 2

cccc 3

现在,我希望有一个表格,其中列出了人名,以及一组支票框,每个组的一个复选框。滚动浏览人员时,如果此人在该组中有条目,则会在框中打勾;另外,如果在框中放置了一个支票,则会在person_Group_membership表中输入相应的条目。


我只是不确定这样做的正确方法。谢谢!

Okay here goes,

I have 3 tables

[Person Table]
Person_ID: text;
first_name: text;
last_name: text;

[Group_Definition Table]
Group_ID; Autonumber;
Group_Desc: Text;

[Person_Group_Membership]
person_id: text;
Group_ID; number;

Sample Data

[Person Table]
aaaa Jim Johnson
bbbb Joe Jones
cccc John Doe

[Group_Definition Table]
1 GroupA
2 GroupB
3 GroupC

[Person_Group_Membership]
aaaa 1
bbbb 1
aaaa 2
cccc 3

Now, I would like to have a form, where it lists the persons name, and a group of check boxes, one checkbox for each group. as you scroll through the people, there is a check in the box if the person has an entry in that group; also, if a check is placed in the box, a corresponding entry is made in the person_Group_membership table.

I am just not sure of the proper way to go about doing this. Thanks!

推荐答案

措辞严谨的问题:)

不幸的是我认为这是一个CrossTab查询问题(不是我非常喜欢的一个领域)好的)。

我认为,每个用户的组的交叉表查询是必需的。它不会更新,因此需要CheckBoxes的AfterUpdate事件中的代码在选中时添加和删除记录。这样的代码总是需要通过调用 Me.Requery 来成功。这有意义吗?


PS。你可以从其他专家那里得到一些其他更好的想法。
Nicely worded question :)
Unfortunately I think this is a CrossTab query question (not an area I''m very good in).
I think though, that a crosstab query of the groups per user would be required. It would not be updateable though, so would require code in the AfterUpdate events of the CheckBoxes to add and delete records as and when checked. Such code would always need to be succeeded with a call of Me.Requery. Does this make sense?

PS. You may get some other, better ideas from the other Experts.


你好,gixxer。


它需要一些不寻常的表格设计。
  • 表示人员成员资格的最简单方法是使用子表单(数据表或连续表单视图),假设基于[人员表]的主表单是[frmPeople],子表单是[ frmMembership]
    • 只要你想看到所有带复选框的组,表示该子表单的表单对象的记录源的成员资格应该是[Group_Definition Table]和[Person_Group_Membership]的外连接,如下所示
Hi, gixxer.

It will require some unusual design of the form.
  • the simplest way to represent person''s membership is to use subform (datasheet or continuous forms view), lets say main form based on [Person Table] is [frmPeople], subform is [frmMembership]
    • as soon as you want to see all groups with checkboxes indicating membership the recordsource for form object of this subform should be outer join of [Group_Definition Table] and [Person_Group_Membership], like the following
展开 | 选择 | Wrap | 行号


响应可能重新出现的任何机会贴?


第一个代码示例中的一些文本被截断为仅仅是字母T。让它有点难以理解...


非常感谢,如果可以,

mark
Any chance the response could be re-posted?

Some of the text in the first code example has been truncated to be nothing more than the letter "T" making it a bit difficult to follow...

big thanks if you can,
mark


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

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