I want to pass an array dimension via a parameter. I want a single sub to work with calls in which the array dimension will change. I get a "constant expression required" error when I try to call this:
rivate Sub SingleRcrd(ByRef iArrayBound As Integer, ByVal ThisSql As String) 'On Error GoTo ErrorHandler Dim rs As ADODB.Recordset Dim i As Integer Dim UploadArr(iArrayBound) Set rs = New ADODB.Recordset rs.Open ThisSql, conn, 1, 2 For i = 0 To iArrayBound UploadArr(i) = rs(i).Value Next i rs.Close Set rs = Nothing Set rs = New ADODB.Recordset rs.Open ThisSql, srvr_conn, 1, 2 For i = 0 To iArrayBound rs(i).Value = UploadArr(i) Next i rs.Update rs.Close Set rs = Nothing Exit SubErrorHandler: Beep ErrorHandlerEnd Sub