需要事件过程代码 [英] Event Procedure code needed

查看:97
本文介绍了需要事件过程代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将表单中的下拉列表信息提供给此代码,以便在Access MS Office 2000中创建和执行dynamic_query。所有这些工作正常但我需要额外的代码(措辞和格式)才能添加GROUP BY和ORDER BY信息(从表单提供)到查询。任何人都能为我提供这段代码中的措辞能够做到吗?


这是示例代码。

I feed dropdown list information from a form to this code to create and execute a dynamic_query in Access MS Office 2000. All this works fine but I need additional code (wording and format) to be able to add GROUP BY and ORDER BY information (provided from the form) to the query. Can anybody supply the wording in this code set for me to be able to do this?

This is the sample code.

展开 | 选择 | Wrap | 行号

推荐答案




分组依据在select语句中的Where子句之后使用。


Group By [Column Name Reference] [Criteria]


Order by出现在语句的末尾,列按顺序出现。


按[列名称参考1](升序),[列名称参考2]排序描述(降序)


希望这会有所帮助


Leon
Hi,

Group by is used after the Where clause in the select statement.

Group By [Column Name Reference] Having [Criteria]

Order by appears at the end of the statement with the columns appearing in sequence of order.

Order by [Column Name Ref 1] (ascending), [Column Name Ref 2] Desc (Descending)

Hope this helps

Leon


这一切似乎都很复杂且冗长如果您所追求的只是(在第一个实例中)过滤您正在运行的表单,并且作为附录,请将GROUP BY和ORDER BY控件应用于您的运行表单。


不幸的是,你不是很清楚你想要什么或需要什么。您是否已经在原始数据源中设置了GROUP BY的基础知识?为了最有帮助地回答我们需要这些信息。


暂时缺席,我会说通过将Me.Filter属性设置为您拥有的SQL WHERE字符串可以更轻松地完成过滤创建但没有单词WHERE。如果尚未设置,你还必须将Me.FilterOn设置为True。


使用OrderBy&属性的订购也是如此。 OrderByOn。
This all seems very convoluted and long-wnded if what you''re after is simply (in the 1st instance) to filter your running form, and as an addendum, apply GROUP BY and ORDER BY control to your running form.

Unfortunately, you''re not very clear exactly what you want or need. Do you already have the basics of the GROUP BY set up in the original data source? To answer most helpfully we need this info.

In its absence for now, I would say that filtering is more easily done by setting the Me.Filter property to the SQL WHERE string you have created but without the word WHERE. You must also set Me.FilterOn to True if it''s not already so set.

Similar is true for ordering using the properties OrderBy & OrderByOn.


@Echidna


我感谢您的回复。不幸的是,它并没有把我带到下一步。我是新手。我有一本关于SQL编程的书,我可以在需要时找到它的语法。在这种情况下,我需要帮助我的代码中的确切措辞和标记。下面是一个示例(请参阅我发布的SQL代码):
@Echidna
I appreciate your response. Unfortunately, it doesn''t take me to the next step. I''m a novice. I have a book on SQL programming and I can find the syntax when I need it. In this case, I need help with the exact wording and marking in my code. Here is a sample (refer to my posted SQL code):
展开 | 选择 | Wrap | 行号


这篇关于需要事件过程代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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