子表单链接? [英] Subform Link?

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

问题描述

我正在创建一个跟踪我们

工程师的技术技能的数据库。大约有200种技术,他们将需要通过给自己排名来填写。他们某些字段

将不会填写,而其他字段则不会填写。以下是一个例子:


员工#1


语言技能经验(年)

C ++ 3 4

VB 2 2

Java

BASIC 5 10

Neworking技能经验

Bridges 1 1

Hubs

LAN 4 5


这是我的问题...

我想我会创建一个包含一般信息的表单和一个子表单,其中包含

不同的主要类别(语言,网络,数据库)。怎么做

我链接表单/子表单。如果我链接员工姓名,它只会显示已经拥有员工姓名的
字段,因此子表单将显示

没有记录。

解决方案

您的员工与技能之间存在多对多关系,即

一名员工可能拥有多项技能,而且一项技能可能由很多

不同的员工。要解决此问题,您需要另一个表,其中包含每个人拥有的每项技能的

行:


tblEmployee:每位员工一行

-----------------

EmployeeID自动编号主键(pk)

姓氏文字

...


tblSkillCategory

---------------

SkillCatID AutoNumber pk

SkillCat文字技能类别名称


tblSkill:每种技能一行。

---- ------

SkillID自动编号

技能文字技能名称

SkillCatID编号(长)fk to tblSkillCat.SkillCatID


tblEmployeeSkill:每个员工和技能组合一行。

-------------- --------

员工ID号码(长)fk to tblEmployee.EmployeeID

SkillID Number(Long)f.k。 to tblSkill.SkillID

BeginYear Number(整数)年人获得此技能。


对于界面,你将有一个绑定到tblEmployee的主表单,一个绑定到tblEmployeeSkill的
子表单。连续子表单将有一个用于选择技能的组合

框。选择适用于员工的技能,

每行一个。


BTW,我建议使用BeginYear而不是存储年数

员工有这项技能。通过这种方式,您可以随着时间的推移继续计算正确的

年数。


-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


turtle < KO **** @ vistacontrols.com>在消息中写道

news:58 ************************** @ posting.google.c om ...

我正在创建一个跟踪我们
工程师技术技能的数据库。他们需要通过给自己排名来填写大约200种技术技能。他们某些领域不会填写,而其他领域则不会填写。这是一个例子:

员工#1

语言技能经验(yrs)
C ++ 3 4
VB 2 2
Java
BASIC 5 10

Neworking Skill Experience
Bridges 1 1
Hubs
LAN 4 5

这是我的问题.. 。
我想我会创建一个包含一般信息和子表单的表单,其中包含不同的主要类别(语言,网络,数据库)。如何
我链接表单/子表单。如果我链接员工姓名,它将只显示已经拥有员工姓名的字段,因此子表单将不显示任何记录。



< blockquote> Allen,


非常感谢您的详细回复。这将很有帮助
。一个问题:对于tblEmployeeSkill,你说的每一个员工和技能组合都有一个

行。这是否意味着

如果我有200种不同的技能,每个员工需要在具有这200种技能的tblEmployeeSkill中拥有

记录。哪个会b / b $ b意味着每次新员工开始我都需要在他的名下加上200

技能。这是正确的吗?


再一次......非常感谢你的帮助


基思

< br>

ko****@vistacontrols.com (海龟)写在

新闻:58 ************************* @ posting.google.co m:

Allen,

非常感谢您的详细回复。这将有很大帮助。一个问题:对于tblEmployeeSkill,你说的是每一个员工和技能组合的一行。这是否意味着
如果我有200种不同的技能,每个员工需要在具有这200种技能的tblEmployeeSkill中拥有
记录。这意味着每当新员工开始时,我都需要在他的名下加上200技能。这是正确的吗?

再一次......非常感谢你的帮助

基思




如果每个员工都有200个技能,你拥有一支优秀的员工队伍。在我的工作中

技能(和培训)数据库,管理大约60项技能,需要

认证和定期培训,分布在600多名员工。


有些员工有4或5个技能,有些则有2或3个。即使你有200美元的技能,你只需要为新员工增加技能记录

获得技能。当员工或团队通过

复习时,我们会添加新条目。在我们的案例中,10年后,

表中只有大约5000个条目。


如果一个emplyee没有技能没有记录获得添加。

您可以根据是否存在empID-skillID

记录来查询。


它是'创建一个能够显示员工的b $ b b记录和多选列表框以选择要添加的技能,以及

小代码甚至是简单代码的表单并不困难希望这会有所帮助。


Bob Q


I am creating a database that tracks the Techinical Skills of our
engineers. There are about about 200 techinical skills that they will
need to fill out by giving themselves a ranking. Some fields they
will not fill out and others they will. Here is an example:

Employee # 1

Languages Skill Experience (yrs)
C++ 3 4
VB 2 2
Java
BASIC 5 10

Neworking Skill Experience
Bridges 1 1
Hubs
LAN 4 5

Here is my question...
I figured I would make a form with general info and a subform with the
different major categories (languages, networking, Databases). How do
I link the form/subform. If i link on employee name it will only show
fields that already have the employee name therefore the subform will
show no records.

解决方案

You have a many-to-many relationship between your employees and skills, i.e.
one employee may have many skills, and one skill may be possessed by many
different employees. To resolve that, you need another table that contains a
row for every skill every person has:

tblEmployee: one row for each employee
-----------------
EmployeeID AutoNumber primary key (p.k.)
Surname Text
...

tblSkillCategory
---------------
SkillCatID AutoNumber p.k.
SkillCat Text Name of skill category

tblSkill: one row for each skill.
----------
SkillID AutoNumber
Skill Text Name of skill
SkillCatID Number (Long) f.k. to tblSkillCat.SkillCatID

tblEmployeeSkill: one row for every combination of employee and skill.
----------------------
EmployeeID Number (Long) f.k. to tblEmployee.EmployeeID
SkillID Number (Long) f.k. to tblSkill.SkillID
BeginYear Number (Integer) Year person acquired this skill.

For the interface, you will have a main form bound to tblEmployee, with a
subform bound to tblEmployeeSkill. The continuous subform will have a combo
box for selecting the skill. Select as many skills as apply to the employee,
one per row.

BTW, I''ve suggest a BeginYear rather than storing the number of years the
employee has had the skill. This way you can continue to calculate the right
number of years as time marches on.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"turtle" <ko****@vistacontrols.com> wrote in message
news:58**************************@posting.google.c om...

I am creating a database that tracks the Techinical Skills of our
engineers. There are about about 200 techinical skills that they will
need to fill out by giving themselves a ranking. Some fields they
will not fill out and others they will. Here is an example:

Employee # 1

Languages Skill Experience (yrs)
C++ 3 4
VB 2 2
Java
BASIC 5 10

Neworking Skill Experience
Bridges 1 1
Hubs
LAN 4 5

Here is my question...
I figured I would make a form with general info and a subform with the
different major categories (languages, networking, Databases). How do
I link the form/subform. If i link on employee name it will only show
fields that already have the employee name therefore the subform will
show no records.



Allen,

Thank you so much for your detailed response. It is going to help out
a great deal. One question: For the tblEmployeeSkill you said "one
row for every combination of employee and skill. Does this mean that
if I have 200 different skills that every employee needs to have a
record in the tblEmployeeSkill with those 200 skills. Which would
mean that everytime a new employee starts i would need to add 200
skills under his name. Is that correct?

Once again... thank you so much for your help

Keith


ko****@vistacontrols.com (turtle) wrote in
news:58*************************@posting.google.co m:

Allen,

Thank you so much for your detailed response. It is going to help out
a great deal. One question: For the tblEmployeeSkill you said "one
row for every combination of employee and skill. Does this mean that
if I have 200 different skills that every employee needs to have a
record in the tblEmployeeSkill with those 200 skills. Which would
mean that everytime a new employee starts i would need to add 200
skills under his name. Is that correct?

Once again... thank you so much for your help

Keith



If every employee has 200 skills you have one great workforce. At my work
skills (and training) database that manages about 60 skills which require
certification and periodic training, spread over 600 employees.

Some employees have 4 or 5 skills, others 2 or three. Even if you have
200 skills you only need to add a record to the skills a new employee
acquires as the skill is acquired. When an employee or a group go through
a refresher, we add new entries. there are only about 5000 entries in the
table after 10 years, in our case.

If an emplyee doesn''t have a skill no record gets added.
You can base queries on the presence or absence of an empID-skillID
record.

It''s not a difficult task to create a form that brings up an employee''s
record and a multiselect listbox to select which skills to add, and a
little code or even a macro to create those records.

Hope this helps.

Bob Q


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

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