Will one of you Cyber Buddies show me how to shorten the
below list of If/EndIfs? I'm obviously not good enough
to figure it out myself.
Public Function VBAUpdateInsert(MODE As String, TableName As String, WhereStr As String, ParamArray Arguments() As Variant)
' The following code will convert the single array into a more useful 2 dimensional one.
Dim DataArray(101, 2) As Variant
Dim IntCounter As Integer
Do While IntCounter <= UBound(Arguments)
For IntCounter = 0 To UBound(Arguments)
If IntCounter = 0 Then
DataArray(0, 0) = Arguments(IntCounter)
End If
If IntCounter = 1 Then
DataArray(0, 1) = Arguments(IntCounter)
End If
If IntCounter = 2 Then
DataArray(1, 0) = Arguments(IntCounter)
End If
If IntCounter = 2 Then
DataArray(1, 1) = Arguments(IntCounter)
End If
... through to
If IntCounter = 100 Then
DataArray(50, 0) = Arguments(IntCounter)
End If
If IntCounter = 101 Then
DataArray(50, 1) = Arguments(IntCounter)
End If
Next
Loop ' Then I process the 2 dimensional array...
below list of If/EndIfs? I'm obviously not good enough
to figure it out myself.
Public Function VBAUpdateInsert(MODE As String, TableName As String, WhereStr As String, ParamArray Arguments() As Variant)
' The following code will convert the single array into a more useful 2 dimensional one.
Dim DataArray(101, 2) As Variant
Dim IntCounter As Integer
Do While IntCounter <= UBound(Arguments)
For IntCounter = 0 To UBound(Arguments)
If IntCounter = 0 Then
DataArray(0, 0) = Arguments(IntCounter)
End If
If IntCounter = 1 Then
DataArray(0, 1) = Arguments(IntCounter)
End If
If IntCounter = 2 Then
DataArray(1, 0) = Arguments(IntCounter)
End If
If IntCounter = 2 Then
DataArray(1, 1) = Arguments(IntCounter)
End If
... through to
If IntCounter = 100 Then
DataArray(50, 0) = Arguments(IntCounter)
End If
If IntCounter = 101 Then
DataArray(50, 1) = Arguments(IntCounter)
End If
Next
Loop ' Then I process the 2 dimensional array...