简体   繁体   English

按特定值对Access 2003报表字段中的字段进行排序

[英]sorting a field in a access 2003 report field by a specific value

I'm trying to figure out if there is any vba way of sorting a report field in access 2003. I have this field that contains three different values " Estimated date", "Needs date" and "Date in"; 我试图弄清楚在Access 2003中是否有任何vba方式对报告字段进行排序。我有一个包含三个不同值的字段“估计日期”,“需要日期”和“日期”; what i need is for the field to be sorted first from AZ and then by Date. 我需要的是首先从AZ然后按日期对字段进行排序。 If anyone knows how to do this in either VBA or access2003 please let me know I'm fairly new to access and vba so any help would be greatly appreciated. 如果有人知道如何在VBA或access2003中执行此操作,请让我知道我对访问和vba还是比较陌生,因此将不胜感激。

For an Access report, use the report Group and Sort option to define your sort order. 对于访问报告,请使用报告“组和排序”选项来定义您的排序顺序。 That option over-rides any sort order established by the ORDER BY clause in the report's record source query. 该选项优先于报告的记录源查询中由ORDER BY子句建立的任何排序顺序。

I don't recall exactly where that option is found in the Access 2003 user interface, but suspect you can track it down. 我不记得该选项在Access 2003用户界面中的确切位置,但是怀疑您可以对其进行跟踪。 Meanwhile be aware that Microsoft will discontinue support for Office 2003 in April 2014. 同时请注意,Microsoft将于2014年4月停止对Office 2003的支持。

Here is a screenshot from Access 2007 which shows where the option is located on the ribbon interface. 这是Access 2007的屏幕截图,显示了该选项在功能区界面上的位置。

报告组和排序选项

Yes, go to the queries tab and create a new query based on your table and sort on those fields. 是的,转到“查询”选项卡,然后根据您的表创建一个新查询并在这些字段上进行排序。 Then modify your report to read data from the query and not directly from the table. 然后修改您的报告以从查询而不是直接从表中读取数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM