|
有两个问题。
1、“分类”字段冒出这么多个箭号出来
2、当子窗体没有记录时,会弹一个提示错误的对话框,,如何避免了?
Option Compare Database
Dim dj As Boolean '用于字段排序
======================================================
Private Sub Form_Click() '用于字段排序
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is TextBox Then
If Right(ctrl.Controls(0).Caption, 1) = "↓" Or Right(ctrl.Controls(0).Caption, 1) = "↑" Then ctrl.Controls(0).Caption = Left(ctrl.Controls(0).Caption, Len(ctrl.Controls(0).Caption) - 1)
End If
Next
If dj = True Then
DoCmd.DoMenuItem acFormBar, 5, 1, 1, acMenuVer70
Screen.ActiveControl.Controls(0).Caption = Screen.ActiveControl.Controls(0).Caption & "↓"
dj = False
Else
DoCmd.DoMenuItem acFormBar, 5, 1, 0, acMenuVer70
Screen.ActiveControl.Controls(0).Caption = Screen.ActiveControl.Controls(0).Caption & "↑"
dj = True
End If
End Sub
[ 本帖最后由 goto2008 于 2008-4-13 15:34 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|