排序表,而不是SQL! [英] Sort table, not with SQL!

查看:80
本文介绍了排序表,而不是SQL!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从表单中对表进行排序。我不能使用SQL!


我们有一个由外部供应商创建的Access应用程序。

一种形式表示:请确保表格中的所有记录按

日期排序......


应用程序没有以任何方式锁定或隐藏,但涉及的金额相当于b $ b。我希望能够简单地在这个表格上添加一个按钮

来排序表格。


我试过玩OrderBy,但是似乎无法获得

正确的语法。任何帮助将不胜感激!


=====我的代码=====

Dim tdf As TableDef

Dim db As Database


设置db = CurrentData()

设置tdf = db.TableDefs(" ImportProgramServicePeriods")

tdf.OrderBy =" ValBeginningDate,ASC"

How do I sort a table, from a form. I can''t use SQL!

WE have an Access application that is created by an outside vendor. The
one form states: "Please make sure all records in table are sorted by
date..."

The application is not locked or hidden in any way, but is fairly
involved. I would like to be able to simply add a button to this form
to sort the table.

I''ve tried playing around with OrderBy, but cann''t seem to get the
correct syntax. Any help would be greatly appreciated!

===== My Code =====
Dim tdf As TableDef
Dim db As Database

Set db = CurrentData()

Set tdf = db.TableDefs("ImportProgramServicePeriods")
tdf.OrderBy = "ValBeginningDate, ASC"

推荐答案



"达龙" <沓********** @ gmail.com>在消息中写道

news:11 ********************** @ g49g2000cwa.googlegr oups.com ...

"Daron" <Da**********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
如何从表单中对表进行排序。我不能使用SQL!

我们有一个由外部供应商创建的Access应用程序。
一种形式表明:请确保表中的所有记录按日期排序......

应用程序未以任何方式锁定或隐藏,但是相当有意义。我希望能够简单地在这个表格上添加一个按钮来分类。

我试过玩OrderBy,但似乎无法得到它
正确的语法。任何帮助将不胜感激!

=====我的代码=====
Dim tdf As TableDef
Dim db As Database
设置db = CurrentData()

设置tdf = db.TableDefs(" ImportProgramServicePeriods")
tdf.OrderBy =" ValBeginningDate,ASC"
How do I sort a table, from a form. I can''t use SQL!

WE have an Access application that is created by an outside vendor. The
one form states: "Please make sure all records in table are sorted by
date..."

The application is not locked or hidden in any way, but is fairly
involved. I would like to be able to simply add a button to this form
to sort the table.

I''ve tried playing around with OrderBy, but cann''t seem to get the
correct syntax. Any help would be greatly appreciated!

===== My Code =====
Dim tdf As TableDef
Dim db As Database

Set db = CurrentData()

Set tdf = db.TableDefs("ImportProgramServicePeriods")
tdf.OrderBy = "ValBeginningDate, ASC"




没有排序表这样的东西。这就是关系

数据库的本质。您可以使用查询通过

按排序顺序轻松查看表格的内容。您可以在表单或报表中按排序顺序查看数据。



There is no such thing as sorting a table. That''s the nature of a relational
database. You can easily view the content of a table in sorted order by
using a query. You can view the data in sorted order in a form or a report.


从上面引用:
To quote from above:
如何从表单中对表进行排序。 *我不能使用SQL!* ....
How do I sort a table, from a form. * I can''t use SQL!* ....




如果打开表格,我可以选择列/字段,从记录/排序...菜单中选择

。这就是我需要在代码中复制的内容。


我无法控制原始代码,我们确实收到了更新

偶尔。


我已经在Access中编程超过7年了,并且我完全清楚

,首选的排序方法是使用查询。但是,这不是我的

应用程序。


有一个简单的按钮和几行代码来排序表

是我唯一真正的选择。我们可以在获得

更新时简单地复制和粘贴。


Daron



If I have the table open, I can select the column/field, and sort from
the Records/Sort... menu. This is what I need to replicate in code.

I do not have control over the original code, and we do receive updates
occasionaly.

I have been programming in Access for over 7 years, and am fully aware
that the preferred way to sort is with a query. HOWEVER, this is not my
app.

Having a simple button and a couple of lines of code to sort the table
is my only real option. I can then simply copy and paste when we get an
update.

Daron


Daron写道:
从上面引用:
To quote from above:
如何从表单中对表进行排序。 *我不能使用SQL!* ....
How do I sort a table, from a form. * I can''t use SQL!* ....



如果我打开表,我可以选择列/字段,并从
记录/排序...菜单。这就是我需要在代码中复制的内容。

我无法控制原始代码,偶尔会收到
更新。

我一直在在Access中编程超过7年,我完全清楚首选的排序方法是使用查询。但是,这不是我的应用程序。

有一个简单的按钮和几行代码来排序表
是我唯一真正的选择。我们可以在我们获得更新时简单地复制和粘贴。

Daron



If I have the table open, I can select the column/field, and sort from
the Records/Sort... menu. This is what I need to replicate in code.

I do not have control over the original code, and we do receive
updates occasionaly.

I have been programming in Access for over 7 years, and am fully aware
that the preferred way to sort is with a query. HOWEVER, this is not
my app.

Having a simple button and a couple of lines of code to sort the table
is my only real option. I can then simply copy and paste when we get
an update.

Daron




重点是没有必要排序表,因为那种排序

将不会在其他任何地方使用。不在表格,查询或基于表格的
的报告中。它只会影响你何时直接看到表格,如果有人打算这样做,那么为什么不让他们同时手动对它进行分类呢?

-

我没有查看附加的电子邮件帐户

到此消息。发送给...

在Hunter dot com的RBrandt



The point is that there is no point to sorting a table because that sort
will not be used anywhere else. Not in forms, queries, or reports based on
that table. It only affects when you actually look directly at the table
datasheet and if someone is going to do that then why not have them sort it
manually at the same time?

--
I don''t check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


这篇关于排序表,而不是SQL!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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