Access 2013 - sample array code

My OS is win 7 prof 64 bit and I use Office 365.  i created a simple array in Access 2013, to see if it works, but I get the error "object does not support ..."  Hope the experts can point out where I went wrong from the attached code.  Thank u.
samplearraycode.txt
jegajothyretiredAsked:
Who is Participating?
 
MacroShadowConnect With a Mentor Commented:
btw, there is no need to loop thru the array twice. Try this:
Private Sub Command24_Click()

    Dim aintRandomNum(1 To 10) As Integer
    Dim intX As Integer

    Randomize

    For intX = 1 To 10
        ' load the "aintRandomNum" array with random numbers between 1 and 100 ...
        aintRandomNum(intX) = Int(100 * Rnd + 1)
        ' display the contents of the "aintRandomNum" array ...
        Debug.Print aintRandomNum(intX)
    Next

End Sub

Open in new window

0
 
MacroShadowCommented:
Change
Print aintRandomNum(intX)
To
Debug.Print aintRandomNum(intX)
0
 
Rgonzo1971Commented:
Hi,

shouldnt'be

Debug.Print


Regards
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Gustav BrockCIOCommented:
All you need is:

Debug.Print aintRandomNum(intX)

/gustav
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Or use

Msgbox aintRandonNum(intX)
0
 
jegajothyretiredAuthor Commented:
MacroShadow's code works, thank u.
0
 
jegajothyretiredAuthor Commented:
thank u for the solution. gracias
0
 
MacroShadowCommented:
De nada :-)
0
All Courses

From novice to tech pro — start learning today.