在 Access Runtime 中对连续表单进行排序
Sorting continuous form in Access Runtime
我有一个实际上没有 Access 的客户端,所以他们使用 Access Runtime 2016 来使用我的程序。在运行时版本中没有功能区,但大多数情况下没有功能区。
只有一个问题,用户需要能够按升序或降序排序的连续表格。在完整版的 Access 中,有一个方便的小按钮可以解决这个问题。
我找到了一个解决方案 here, but it doesn't work when I try it. I'm assuming that it's because my client is using Runtime 2016. There is also a question that addresses this for Access 2003,但没有办法(据我所知)为 Access 2007 运行时及更高版本制作按钮。
为 Access 2016 运行时提供排序(和筛选)的推荐方法是什么?
就我个人而言,我从不让我的客户使用 Access UI 进行排序或其他任何操作,我将任何可排序列中 header 的双击事件绑定到使用 [=11] 的代码=] 和 OrderByOn
属性以使用 VBA.
设置排序
示例代码如下:
Private Sub s_Description_DblClick(Cancel As Integer)
If Me.OrderBy = "Description" Then
Me.OrderBy = "Description DESC"
Else
Me.OrderBy = "Description"
End If
Me.Requery
End Sub
我有一个实际上没有 Access 的客户端,所以他们使用 Access Runtime 2016 来使用我的程序。在运行时版本中没有功能区,但大多数情况下没有功能区。
只有一个问题,用户需要能够按升序或降序排序的连续表格。在完整版的 Access 中,有一个方便的小按钮可以解决这个问题。
我找到了一个解决方案 here, but it doesn't work when I try it. I'm assuming that it's because my client is using Runtime 2016. There is also a question that addresses this for Access 2003,但没有办法(据我所知)为 Access 2007 运行时及更高版本制作按钮。
为 Access 2016 运行时提供排序(和筛选)的推荐方法是什么?
就我个人而言,我从不让我的客户使用 Access UI 进行排序或其他任何操作,我将任何可排序列中 header 的双击事件绑定到使用 [=11] 的代码=] 和 OrderByOn
属性以使用 VBA.
示例代码如下:
Private Sub s_Description_DblClick(Cancel As Integer)
If Me.OrderBy = "Description" Then
Me.OrderBy = "Description DESC"
Else
Me.OrderBy = "Description"
End If
Me.Requery
End Sub