Solved

Access 2013 - sample array code

Posted on 2015-02-05
8
507 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
LVL 85
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

688 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