基于其他领域的独特价值观 [英] Unique Values Based on Other Field

查看:51
本文介绍了基于其他领域的独特价值观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个有2列的桌子

- ID_tr

- 类型


类型列中有4个项目。

- 新

- 扩展名

- DIP

- 续订


ID_tr数字是1,2,3,4



我想要一个基于A组合框的报告。组合框可以列出项目新的,扩展名等。


但是,new和延伸应该是你可以在组合框中选择的1项。


组合框应该列出;


- 新的或扩展名

- 续订

- DIP


我似乎无法用独特的价值来做到这一点。

我在查询中创建了一个名为rap_type的额外字段,其中包含一个iif语句,用于检查type是否为type。是续订,如果是,则返回1。


组合框然后列出; 1,3,4 - 正是我想要的。

但是,我不想看到1,3,4但是

- 新的或扩展名
- 续订

- DIP


如果我选择新的或延期的它应该返回1或2的所有记录。


希望这是明确的,你可以帮助我!

谢谢,

皮埃尔

Hi,

I have A table with 2 columns
- ID_tr
- type

The type column has 4 items in it.
- new
- extension
- DIP
- Renewal

The ID_tr numbers are 1,2,3,4

Now, what i would like is the following;

I want A report based on A combobox. The combobox schould list the items "New, extension, etc."

However, "new" and "extension" should be 1 item you can choose in the combobox.

The combobox should list;

- New or extension
- renewal
- DIP

I don''t Seem to able to do this with unique values.
I created an extra field in the query called rap_type with an iif statement that checks if "type" is renewal, and if so, returns "1".

The combobox then Lists ; 1,3,4 - exactly what i want.
However, i don''t want to see 1,3,4 but
- new or extension
- renewal
- DIP

If I choose "new or extension" IT should return all records with 1 or 2.

Hope this is clear and you can help me!
Thanks,
Pierre

推荐答案

我希望你意识到这不是直截了当的事吗?


请发布你现在的方式数据和用于填充ComboBox的SQL。通过新领域,我们可以为您做点什么,但无论您最终如何,都可能非常笨拙。你似乎想要一些没有以适当的方式存储的信息,并且只有那么多人可以做到这一点。
I hope you realise this is anything but straightforward?

Please post what you have now in the way of data and the SQL for populating your ComboBox. With the new field we may be able to do something for you, but whatever you end up with is likely to be very clumsy. You appear to want information which has not been stored in an appropriate way, and there''s only so much one can do with that.


Hello NeoPa,

我会尝试进一步解释;


我有一个生成报告的表格。

表格基于查询包含所有记录。


在表格上有4个组合框,用户可以从中选择某些数据(如[tr_type] new,renewal,extension,DIP)

在表格的下半部分是一个打开报告的按钮。

在查询条件中我使用Like [forms]![frm_report]。[combo_type ]& *


这对于组合框很有用,我会得到超级报告。


但是,现在我必须打印两份报告(类型新和类型扩展名


我想要的是当我从组合框中选择new时,其结果将是是所有记录,其中类型是新或扩展


这是否更好地解释了我的问题?

我真的希望你能帮助我!


提前致谢,

pierre
Hello NeoPa,

I will try to explain a little further;

I have a form for generating a report.
The form is based on a query with all records in it.

On the form there are 4 combo boxes from which the user can choose certain data (like [tr_type] new, renewal, extension, DIP)

On the lower part of the form is a button to open the report.
In the query criteria i use a Like[forms]![frm_report].[combo_type] & "*"

This works great for the comboboxes and i get super reports.

However, now i have to print two reports (a type "new" and a type "extension"

What i want is that when i choose "new" from the combobox with the type in it, the result will be all records where type is either "new" or "extension"

Does this explain my problem better?
I truly hope you can help me!

Thanks in advance,
pierre


这是一个更好的解释皮埃尔,但它不是给我我要求的详细信息。你有问题吗?


听起来你只想从列表中排除记录{2,Extension}。看起来非常简单。


当你来设计和调用报告时,我建议你删除过滤中的任何引用电子表格。相反,在VBA中构建它并仅在它打开时将其应用于报表。这有意义吗? 表单上的示例过滤提供了有关如何管理这些内容的提示。本文侧重于过滤表单,但表单和报表使用相同的方法。
It is a better explanation Pierre, but it doesn''t give me the details I requested. Are you having a problem with that?

It sounds like you simply want to exclude the record {2,"Extension"} from your list. This seems very straightforward.

When you come to designing and invoking the report, I would suggest getting rid of any references in your filtering to the form. Instead, build this in the VBA and apply it to the report only when it''s opened. Does this make sense? Example Filtering on a Form gives tips on how that can be managed. The article focuses on filtering forms, but the same approach is used for Forms and Reports.


这篇关于基于其他领域的独特价值观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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