列表框中字段的订单命令 [英] Order Command for Fields in Listbox

查看:61
本文介绍了列表框中字段的订单命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我该如何写一个on click cmd按钮的代码告诉列表框中的字段按升序排序?

Hello,

How should I write an "on click" code for a cmd button to tell a field in a listbox to order itself in ascending?

推荐答案


你好,


我应该如何写一个on click cmd按钮的代码告诉列表框中的字段按升序排序?
Hello,

How should I write an "on click" code for a cmd button to tell a field in a listbox to order itself in ascending?



请参阅此链接,了解包含源代码的分步示例。

http://www.databasedev.co.uk/sort_listbox_columns.html


I试图解释代码,但由于某种原因,它不适用于我的表格。


我也尝试了这个,但是列表框变成了空白 -


私有子CmdButtonSortByName_Click

将strim作为字符串

strSQL = me.listbox.rowsource& ORDER BY FieldName;"

me.listbox.rowsource = strSQL

End Sub


任何理由你都可以看到?
I attempted the code explained, but for some reason it isn''t working with my form.

I also tried this, but the listbox goes blank -

Private Sub CmdButtonSortByName_Click
Dim strSQL as String
strSQL = me.listbox.rowsource & "ORDER BY FieldName;"
me.listbox.rowsource = strSQL
End Sub

Any reason you can see?



我试图解释代码,但由于某种原因它不能使用我的表格。


我也尝试了这个,但是列表框变成了空白 -


私有子CmdButtonSortByName_Click

将strim作为字符串

strSQL = me.listbox.rowsource& ORDER BY FieldName;"

me.listbox.rowsource = strSQL

End Sub


任何理由你都可以看到?
I attempted the code explained, but for some reason it isn''t working with my form.

I also tried this, but the listbox goes blank -

Private Sub CmdButtonSortByName_Click
Dim strSQL as String
strSQL = me.listbox.rowsource & "ORDER BY FieldName;"
me.listbox.rowsource = strSQL
End Sub

Any reason you can see?



是的。在这一行,你需要在你的应用程序中放置字段的实际名称来代替FieldName。


strSQL = me.listbox.rowsource& ORDER BY FieldName;"

Yes. On this line you need to put the actual name of the field in your application in place of FieldName.

strSQL = me.listbox.rowsource & "ORDER BY FieldName;"


这篇关于列表框中字段的订单命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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