?
Solved

Access 2013 - sample array code

Posted on 2015-02-05
8
Medium Priority
?
514 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 52

Expert Comment

by:Rgonzo1971
ID: 40591184
Hi,

shouldnt'be

Debug.Print


Regards
0
 
LVL 51

Expert Comment

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

Debug.Print aintRandomNum(intX)

/gustav
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 85
ID: 40591186
Or use

Msgbox aintRandonNum(intX)
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 2000 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

Industry Leaders: 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!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

770 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