具体程序如下:
Private Sub Form_Load()
Dim id(3) As Integer
For i = 0 To 3
id(i) = i
Next i
If Inicom(Command1, id) = True Then
msg "ok"
End SubPrivate Function Inicom(cmd() As CommandButton, id() As Integer) As Boolean
On Err GoTo comErr
For Each i In cmd
i.Enabled = False
Next i
For Each i In id
cmd(i).Enabled = True
Next i
comErr:
msg Err.Number & Err.Description
End Function
但老抱错,说类型不匹配,不知是什么原因,请各位指点!
Private Sub Form_Load()
Dim id(3) As Integer
For i = 0 To 3
id(i) = i
Next i
If Inicom(Command1, id) = True Then
msg "ok"
End SubPrivate Function Inicom(cmd() As CommandButton, id() As Integer) As Boolean
On Err GoTo comErr
For Each i In cmd
i.Enabled = False
Next i
For Each i In id
cmd(i).Enabled = True
Next i
comErr:
msg Err.Number & Err.Description
End Function
但老抱错,说类型不匹配,不知是什么原因,请各位指点!
解决方案 »
- msflexgrid转excel,点了没有反应,只有鼠标的漏斗样子,为什么呢?
- 为什么运行不了
- mshflexgrid 只能显示2048条信息吗?怎么能让它显示更多记录呢?
- 请问有谁做过把文件拷贝到磁带机这样的程序?
- 我如何将mshflexgrid中的数据保存到ACCESS中去?
- sql问题请教:类型不匹配,不是通常意义上的转换!!!!
- 如何判断一个文件是否已经被打开??
- 请问该如何实现这种功能呢?
- VB格式动态库的函数调用,怎么转换到DELPHI 里面
- vb程序编完有source htmlhelp setup文件夹怎么生成exe运行程序
- 我做了个试验,难道更新存在这个问题,为什么?我虽是新手,但该问题值得研究!!!
- 使用在程序中 使用ActiveX控件??
Private Sub Form_Load()
Dim id(3) As Integer
Dim i As Integer
For i = 0 To 3
id(i) = i
Next i
If Inicom(Command1, id) = True Then
MsgBox "ok"
End If
End SubPrivate Function Inicom(cmd As Variant, id() As Integer) As Boolean
On Err GoTo comErr
Dim i As CommandButton
Dim j
For Each i In cmd
i.Enabled = False
Next i
For Each j In cmd
cmd(j).Enabled = True
Next j
Exit Function
comErr:
MsgBox Err.Number & Err.Description
End Function
Private Sub Form_Load()
Dim id(3) As Integer
Dim i As Integer
For i = 0 To 3
id(i) = i
Next i
If Inicom(Command1, id) = True Then
MsgBox "ok"
End If
End SubPrivate Function Inicom(cmd As Variant, id() As Integer) As Boolean
On Err GoTo comErr
Dim i As CommandButton
Dim j
For Each i In cmd
i.Enabled = False
Next i
For Each j In cmd
cmd(j).Enabled = True
Next j
Inicom = True
Exit Function
comErr:
MsgBox Err.Number & Err.Description
End Function加上了:Inicom = True