|
Dim i As Integer, tmpName As String, rs As ADODB.Recordset, strSQL As String
On Error Resume Next
DoCmd.RunCommand acCmdAppMaximize
DoCmd.Maximize
Set rs = New ADODB.Recordset
For i = 1 To 6 '你写的是5,改为6,现在是6个图形按钮。
'但是你的CmdBut又只有5个
'所以在本过程前加了一句错误处理on error resume next
tmpName = "CmdBut" & Format(i, "0")
With Me(tmpName)
strSQL = "select itemtext from usysmenuitem where mainitem=" & i & " and itemnumber=0;"
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If Not rs.EOF Then
.Caption = rs(0)
End If
........................................... |
|