|
本帖最后由 todaynew 于 2009-12-6 16:37 编辑
1、写一个窗体的子程序
Private Sub MyTab(myField As String)
Dim ctls As Controls
Dim rs As New ADODB.Recordset
Dim ssql As String
Dim i As Long
ssql = "select * from 索引排序表"
rs.Open ssql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set ctls = Me.Form.Controls
For i = 1 To rs.RecordCount
ctls(rs("字段")).TabIndex = rs(myField)
rs.MoveNext
Next
End Sub
2、引用该子程序
Private Sub 更改索引_Click()
Dim a As Long
a = nz(InputBox("请选择顺序:1=原顺序;2=现顺序"),1)
Select Case a
Case 1
Call MyTab("原顺序")
Case 2
Call MyTab("现顺序")
Case Else
MsgBox "选择错误!"
End Select
End Sub
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|