Solved

Access 2013 - sample array code

Posted on 2015-02-05
8
501 Views
Last Modified: 2015-02-05
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
0
Comment
Question by:jegajothy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 40591181
Change
Print aintRandomNum(intX)
To
Debug.Print aintRandomNum(intX)
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40591184
Hi,

shouldnt'be

Debug.Print


Regards
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40591185
All you need is:

Debug.Print aintRandomNum(intX)

/gustav
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 84
ID: 40591186
Or use

Msgbox aintRandonNum(intX)
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 40591198
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
 

Author Comment

by:jegajothy
ID: 40591551
MacroShadow's code works, thank u.
0
 

Author Closing Comment

by:jegajothy
ID: 40591552
thank u for the solution. gracias
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 40592387
De nada :-)
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This lā€¦

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question