使用VB从表中返回True / False记录 [英] Returning True/False records from a table using VB

查看:253
本文介绍了使用VB从表中返回True / False记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好,


有人可以指导我如何从表中返回记录。我目前有一张约21个字段和21条记录的表。我有一个字段只是文本,其余字段是复选框,允许用户为文本字段中的每个记录选择true / false。


IE

Good afternoon,

Can someone please guide me towards how to return records from a table. I currently have a table with about 21 fields, and 21 records. I have one field that is just text and the remaining fields are checkboxes, which allows the user to select true/false for each record in the text field.

I.E.

展开 | 选择 | Wrap | 行号

推荐答案

您的意思是返回chkbox1为真的记录,无论其他是什么,chkbox2为真,或者Chkbox3为真,具体取决于用户想要查看的复选框字段?
Do you mean returning the records where chkbox1 is true regardless of the others, chkbox2 is true, or Chkbox3 is true depending on which check box field the user wanted to see?


你的表格设计没有标准化给这个麻烦。

你需要每行21行同一文本。

我想这是一种多种选择,你需要三个字段:

1)文字

2)选项

3)是否

现在你可能让Option1为真或假

现在你可能会有Option2为True或False等。


这样的表可以通过选中YesNo字段为True来立即过滤。


现在您需要将表格标准化为:


选择文本,01作为Origin,来自tblX的Check01,其中Check01 = True

UNION

选择文本,02作为Origin,来自tblX的Check01,其中Check02 = True

...等,直到

选择文本,21和作为Origin,来自tblX的Check21,其中Check21 = True;


然后可以在新查询中使用UNION从UNION查询中过滤True Check01。

Nic; o)
Your table design isn''t normalized, giving this trouble.
You would need for every row 21 rows for the same text.
I guess it''s a kind of multiple choice and you would need three fields:
1) Text
2) Option
3) YesNo
Now you''ll probably have Option1 being True or False
Now you''ll probably have Option2 being True or False, etc.

Such a table can be filtered instantly by checking the YesNo field for being True.

Now you would need to normalize the table like:

select Text, "01" as Origin, Check01 from tblX where Check01=True
UNION
select Text, "02" as Origin, Check01 from tblX where Check02=True
...etc,till
select Text, "21" as Origin, Check21 from tblX where Check21=True;

That UNION can then be used in a new query for filtering the True Check01 from the UNION query.

Nic;o)


感谢您的回复,


我不清楚你的餐桌设计是什么意思不被诺贝尔化?

我是否应该在表单中使用此复选框表,然后将信息传递给表格?



Thank you for your response,

I am not clear on what you mean by my table design not being normailzed?
Should I have this checkbox table in a form instead, and then have the information passed to a table??





你的表格设计没有规范化,给你带来了麻烦。

你需要每行21行同一文本。

我想这是一种多种选择,你需要三个字段:

1)文字

2)选项

3)YesNo

现在你可能让Option1为真或假

现在你可能有Option2为True或False等。


这样的表可以过滤inst通过检查YesNo字段是否为真。


现在您需要将表格标准化为:


选择文本,01 ;作为Origin,来自tblX的Check01,其中Check01 = True

UNION

选择文本,02作为Origin,来自tblX的Check01,其中Check02 = True

...等,直到

选择文本,21和作为Origin,来自tblX的Check21,其中Check21 = True;


然后可以在新查询中使用UNION从UNION查询中过滤True Check01。

Nic; o)
Your table design isn''t normalized, giving this trouble.
You would need for every row 21 rows for the same text.
I guess it''s a kind of multiple choice and you would need three fields:
1) Text
2) Option
3) YesNo
Now you''ll probably have Option1 being True or False
Now you''ll probably have Option2 being True or False, etc.

Such a table can be filtered instantly by checking the YesNo field for being True.

Now you would need to normalize the table like:

select Text, "01" as Origin, Check01 from tblX where Check01=True
UNION
select Text, "02" as Origin, Check01 from tblX where Check02=True
...etc,till
select Text, "21" as Origin, Check21 from tblX where Check21=True;

That UNION can then be used in a new query for filtering the True Check01 from the UNION query.

Nic;o)


这篇关于使用VB从表中返回True / False记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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