Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display array grieve

Status
Not open for further replies.

SmokeEater

Technical User
Feb 14, 2002
90
CA
I have created a multidimensional array and want to either output it to a report or form. I have found code to display one dimensional code in the immediate window but can't get it to work for multi dimensions.

Code:
Sub DisplayArray(InArray() As String)
   Dim i As Integer
   For i = 1 To UBound(InArray)
      Debug.Print InArray(i)
   Next i
End Sub

Thanks for the help
 
Typed, untested:
Sub DisplayArray(InArray() As String)
Dim i As Integer, j As Integer
For i = LBound(InArray, 1) To UBound(InArray, 1)
For j = LBound(InArray, 2) To UBound(InArray, 2)
Debug.Print InArray(i, j),
Next j
Debug.Print
Next i
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes it is very helpful. Will the same code work to output to a form or report?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top