标题:Access 2007下该代码老提示出错
取消只看楼主
pdsjm
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-7-9
 问题点数:0 回复次数:0 
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]]
搜索更多相关主题的帖子: Access 提示 代码 Set New 
2008-07-09 19:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-223293-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.666884 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved