如何在查询结果中显示图标? [英] How to display icons in results of query?

查看:87
本文介绍了如何在查询结果中显示图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这有可能吗?

基本上我有一个查询设置,它返回订单信息(订单号,日期,总数等)以及2个状态字段。

Essentially I have a query set up which returns order information (order number, date, total etc) as well as 2 status fields.

1)购买状态:此订单的供应商购买状态。价值:无,部分,完整。 

1) Purchases Status: Status of supplier purchases for this order. Value: none, partial, complete. 

2)运输状态:值:无,部分,完整。

2) Shipping Status: Values: none, partial, complete.

因为我还在在开发阶段,我仍然只有这些状态的文本。然后我有了使用条件格式的颜色编码的想法,但你最终得到一个充满颜色的表,它实际上变得太多。

Since I am still in the development phase, I still only have text for these statuses. Then I had the idea of color coding using conditional formatting, but you end up with a table full of colors and it actually becomes too much.

我的下一个想法是有一套6小图标:3代表3个购买状态,3代表3个运输状态。根据当前状态,每一行(即记录)总是会显示2个图标。

My next idea was having a set of 6 little icons: 3 representing the 3 Purchase Statuses, and 3 representing the 3 Shipping statuses. Each row (ie record) would always display 2 icons depending on the current status.

那么有没有办法在数据表表格上显示小图标?我知道这很容易在Excel中完成.....

So is there any way to display little icons on a datasheet form? I know this is easily done in Excel.....

谢谢!

推荐答案

据我所知,不是数据表,而是连续形式 - 更灵活,可以设计成数据表......

Not in datasheets as far as I know, but in continuous forms - which are much more flexible and can be designed to look like datasheets...

图像控件可以绑定到包含图像路径的文本字段或通过其控制源属性返回这些路径的函数。 

Image Controls can be bound to Text Fields containing paths to images or to functions returning those paths, through their control source property. 

尝试在标准模块中编写功能,根据状态返回您需要查看的图片的路径。 

Try writing a function in a standard module to return the path to the image you need to see, based on status. 

例如,这将根据regionID返回图像路径,其中奇数ID返回一个图像,甚至ID返回另一个图像。

For example, this returns image path according to regionID with odd IDs returning one image and even IDs returning another.

Function GetImage(lngRegionID As Long) As String Dim s As String

'这假设图像与数据库位于同一文件夹中。

' This assumes the images are in the same folder as the database.

否则需要完整路径。
If(lngRegionID Mod 2)= 0然后
s =" Cake.jpg"
Else
s =" Capture.png"
结束如果
GetImage = s

结束功能

' Full path is needed otherwise. If (lngRegionID Mod 2) = 0 Then s = "Cake.jpg" Else s = "Capture.png" End If GetImage = s End Function

文本框的控件来源属性将be(使用属性函数时需要=符号):

The control source property of the textbox would be (the = sign is needed when using functions for properties):

=GetImage([RegionID])


这篇关于如何在查询结果中显示图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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