checKBOX 问题
Private Sub Check2_Click()Call check_quanxuan(Check2.Value, Check1.count, Form57)
End Sub
Public Function check_quanxuan(ByVal ck_value As Integer, ByVal ck_count As Integer, ByVal frm As Form)
With frm
If ck_value = 1 Then
For i = 0 To ck_count - 1
.Check1(i).Value = 1
Next
Else
For i = 0 To ck_count - 1
.Check1(i).Value = 0
Next
End If
End With
End Function
这样可以实现全选功能,但每个调用的窗体都要用check1才可以,这样感觉不够通用,
我是这样写的Call check_quanxuan(Check2.Value, Check1.count, Form57,check1)
Public Function check_quanxuan(ByVal ck_value As Integer, ByVal ck_count As Integer, ByVal frm As Form,byval ch as checkbox)
但老是提示类型出差。
怎么写一个通用的全选函数,把它放在模块里,所有窗体都可以调用。