MS Access 2003 - 格式化列表框中结果的问题
所以我有一个列表框,以类似表格的格式显示来自 crossyab 查询的平均值。这正是我需要的查询是对的,只有一件事。我必须将查询中的字段属性设置为格式:standard..decimal:2。这正是我所需要的。然而......列表框不会接受这一点。
首先,我在列表框的属性中输入交叉表 sql...然后遇到了这个问题。那么我实际上只是创建了查询对象,保存它并将其设置为列表框的行源。仍然不起作用......当我打开查询时,它是正确的格式。
那么有没有办法进一步格式化文本框呢?有没有办法告诉它将返回值的小数位数限制为一到两位?
谢谢!
So I have a list box that displays averages in a table like format from a crossyab query. It's just what I need the query is right, there is just one thing. I had to set the field properties in the query as format: standard..decimal:2. Which is exactly what I needed. However..the list box will not pick up on this.
First I typed the crosstab sql into the list box's properties....and then I ran into this problem. So then I actually just created the query object, saved it and set that as the rowsource for the list box. Still won't work....when I open the query it is the correct format.
So is there a way to further format a text box? Is there a way tell it to limit decimal places to one or two on returned values?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在查询中使用Format函数将数值转换为格式化字符串。以下是我从立即窗口复制的示例:
编辑:以下是在查询中使用 Format 函数的示例。
使用保存的交叉表查询代替 MyTable 尝试类似的方法。
Try the Format function in your query to transform your numerical values to formatted strings. Here is a sample I copied from the Immediate Window:
Edit: Here is an example using the Format function in a query.
Try a similar approach using your saved crosstab query in place of MyTable.
您的列表框对象有自己的 Format 属性。我建议输入“#,###.##”。这将显示带有逗号(如果需要)和 2 位小数的数据。
编辑:哎呀。我正在考虑 ComboBox 控件,而不是 ListBox 控件。作为道歉,请接受此建议 20% 的折扣。
Your listbox object has a Format property of it's own. I would suggest entering "#,###.##". This will display the data with a comma (if needed) and 2 decimal places.
EDIT: Whoops. I was thinking of a ComboBox control, not a ListBox Control. By way of apology, please accept a 20% discount off this advice.