Function NFormM(ByVal iStar As Integer, iEnd As Integer, Num As Integer, Optional StrAll As String)
Dim i, j, k As Integer
Dim W1(14), W2(14), W3(14) As String
If Num = 0 Then
Me.Text30 = Me.Text30 & StrAll & vbCrLf
Else
k = 0
For j = 1 To 14
W1(j) = ""
W1(j) = Nz(Me.Controls("W1" & Format(j, "00")), "N")
W2(j) = ""
W2(j) = Nz(Me.Controls("W2" & Format(j, "00")), "N")
If W1(j) = "N" Then
k = k + 1
If W2(j) <> "N" Then
W3(k) = W2(j)
End If
Else
k = k + 1
W3(k) = W1(j)
End If
Next j
For i = iStar To iEnd
DoEvents
NFormM i + 1, iEnd, Num - 1, StrAll & W3(i) & " - "
Next i
End If
End Function
但还是没解决空格和必选项的问题作者: FBR2002 时间: 2007-10-13 20:31
原帖由 cuxun 于 2007-10-13 19:07 发表
Dim i, j, k As Integer
这样只是给K定义了整型的值,i,j是没定义类型的.
Dim i As Integer
Dim j As Integer
Dim k As Integer
问题不在这儿。好象可以用逗号分开定义的。
关键还是在组合函数的定义:NFormM i + 1, iEnd, Num - 1, StrAll & W3(i) & " - "作者: FBR2002 时间: 2007-10-13 21:09
对组合函数的定义做了些改动,代上文本编号是乎是一种方法。