Solved

Access 2013 - sample array code

Posted on 2015-02-05
8
487 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
8 Comments
 
LVL 27

Expert Comment

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

Expert Comment

by:Rgonzo1971
ID: 40591184
Hi,

shouldnt'be

Debug.Print


Regards
0
 
LVL 49

Expert Comment

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

Debug.Print aintRandomNum(intX)

/gustav
0
 
LVL 84
ID: 40591186
Or use

Msgbox aintRandonNum(intX)
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now