标题: 求解: 编译错误:缺少= [打印本页] 作者: cocopig 时间: 2014-1-24 16:43 标题: 求解: 编译错误:缺少= 编写了如下函数:
Public Sub Alter(whereToAlter As Form, trueOrFalse As Boolean)
Dim ctl As Control
If trueOrFalse = True Then
For Each ctl In whereToAlter.Controls
ctl.Locked = True
Next
Else
If trueOrFalse = False Then
For Each ctl In whereToAlter.Controls
ctl.Locked = False
Next
End If
End If
End Sub
然后我在其他地方执行:
Private Sub cmdAlter_Click()
Alter (Forms.frmDeviceInfo,True)
End Sub
结果提示:“编译错误,缺少=”..............求解,我是否漏了什么?? 作者: wanglinghuan 时间: 2014-1-24 17:00
首先:函数名Alter为access中的已用关键字,建议改名;
其次:改成如下语句再试试
Dim ctl As Control
For Each ctl In whereToAlter.Controls
ctl.Locked = trueOrFalse
Next
End Sub 作者: zhuyiwen 时间: 2014-1-24 17:16