主题:[讨论]请问这个问题怎么解决?大家帮忙看看
我的程序如下:
Dim i As Integer
Private Sub Command3_Click()
'为操作员设置权限
If DataList1.SelectedItem Then
If DataList1.BoundText <> "" Then
Adodc2.RecordSource = "select * from 权限信息表 where 操作员名称=" & DataList1.BoundText & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
For i = 0 To 4
If Check1(i).Value = 1 Then Adodc2.Recordset.Fields(i) = 0 Else Adodc2.Recordset.Fields(i) = 1
Next i
Adodc2.Recordset.Update '更新记录
End If
End If
MsgBox "设置权限已完成!"
Else
MsgBox "请选择操作员!"
End If
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub DataList1_Click()
'查看操作员权限
Adodc2.RecordSource = "select * from 权限信息表 where 操作员名称='" & Trim(DataList1.BoundText) & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
For i = 0 To 4
If Adodc2.Recordset.Fields(i) = 0 Then Check1(i).Value = 1 Else Check1(i).Value = 0
Next i
Adodc2.Recordset.Update '更新记录
End If
End Sub
运行完后出现这样的问题:
实时错误'3265'项目在所需的名称或序数中未被发现
调试时程序指到:Private Sub DataList1_Click()中:
If Adodc2.Recordset.Fields(i) = 0 Then
我想了半天也不知道怎么解决,请好心人帮帮忙!先谢过了!
Dim i As Integer
Private Sub Command3_Click()
'为操作员设置权限
If DataList1.SelectedItem Then
If DataList1.BoundText <> "" Then
Adodc2.RecordSource = "select * from 权限信息表 where 操作员名称=" & DataList1.BoundText & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
For i = 0 To 4
If Check1(i).Value = 1 Then Adodc2.Recordset.Fields(i) = 0 Else Adodc2.Recordset.Fields(i) = 1
Next i
Adodc2.Recordset.Update '更新记录
End If
End If
MsgBox "设置权限已完成!"
Else
MsgBox "请选择操作员!"
End If
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub DataList1_Click()
'查看操作员权限
Adodc2.RecordSource = "select * from 权限信息表 where 操作员名称='" & Trim(DataList1.BoundText) & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
For i = 0 To 4
If Adodc2.Recordset.Fields(i) = 0 Then Check1(i).Value = 1 Else Check1(i).Value = 0
Next i
Adodc2.Recordset.Update '更新记录
End If
End Sub
运行完后出现这样的问题:
实时错误'3265'项目在所需的名称或序数中未被发现
调试时程序指到:Private Sub DataList1_Click()中:
If Adodc2.Recordset.Fields(i) = 0 Then
我想了半天也不知道怎么解决,请好心人帮帮忙!先谢过了!