Access 2007下该代码老提示出错
程序代码:
Private Sub Fillbtns() '显示切换框中的列表 '按钮数量 Const conNumButtons As Integer = 8 Dim rs As New ADODB.Recordset Dim strSQL As String Dim intbtn As Integer Me![btn1].SetFocus For intbtn = 2 To conNumButtons Me("btn" & intbtn).Visible = False Me("lbl" & intbtn).Visible = False Next intbtn '打开表Switchboard Items strSQL = "SELECT * FROM [Switchboard Items]" strSQL = strSQL & "WHERE [ItemNumber]>0 AND [SwitchboardID]=" & Me![SwitchboardID] strSQL = strSQL & "ORDER BY [ItemNumber]" Set rs = GetRs(strSQL) If (rs.EOF) Then Me![lbl1].Caption = "此切换面板页上无项目。" Else While Not ((rs.EOF)) Me("btn" & rs![ItemNumber]).Visible = True Me("lbl" & rs![ItemNumber]).Visible = True Me("lbl" & rs![ItemNumber]).Caption = rs![ItemText] rs.MoveNext Wend End If '关闭数据集合和数据库 rs.Close Set rs = Nothing End Sub
" border="0" />
" border="0" />
" border="0" />
[[it] 本帖最后由 pdsjm 于 2008-7-9 19:04 编辑 [/it]]