Welcome to Dream.In.Code
Become a VB Expert!

Join 149,459 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,142 people online right now. Registration is fast and FREE... Join Now!




Displaying array

 
Reply to this topicStart new topic

Displaying array

GrahamPaul
21 Jan, 2008 - 03:32 AM
Post #1

New D.I.C Head
*

Joined: 9 Dec, 2007
Posts: 9


My Contributions
Ok, so I have a program which asks the user 15 multiple choice questions from a database.

When the user answers incorrectly, the question number and question type is added to a 2D array.

I want to display this in a picturebox once all of the questions have finished. I can do this successfully on the same form as the questions, however it has to be on a separate form. However, using the same code it does not work on the other form. I have declared my array globally.

I have uploaded my entire program in a .rar file for you to see for yourself.
http://www.uploadcomet.com/download.php?fi...ff666009c78389e

On the program you will see a picture box on the 'Test1' form which displays the array. This is only there to test it. In the final program I want it to display on the 'Revision' form. As you can see this does not happen.

I hope I have provided enough info.

Thanks
-GrahamP.

This post has been edited by GrahamPaul: 21 Jan, 2008 - 03:32 AM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Displaying Array
21 Jan, 2008 - 09:08 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Well first no one in their right mind is going to go and install a program just to see the file content you uploaded. So you might want to put the content on a server that people can access without installation of a program (Ziango requires install).

Assuming you are in VB 6... have you defined in the array in a bas module to make it global? Because if you just defined it at the top of the code in a form it is only global to the form.

Have you tried accessing the picturebox on Revision form through the forms name? That way you can read the array in your bas module and put it on your revision form via your test1 form and then show the revision form.

smile.gif
User is offlineProfile CardPM
+Quote Post

GrahamPaul
RE: Displaying Array
21 Jan, 2008 - 12:38 PM
Post #3

New D.I.C Head
*

Joined: 9 Dec, 2007
Posts: 9


My Contributions
Sorry, didn't realise you had to download software for that.

I have dimensioned it globally (bas). I'm not following what you say after that though.

My array shows on the Test form with questions, but I don't want it to. I click a CMD button to view the form which I want to show the array, but it does not show (even though the code is exactly the same).

I could e-mail the .RAR file if that helps?

Thank you,
-GrahamP.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Displaying Array
21 Jan, 2008 - 02:33 PM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,300



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
It would better if you just post your code here using code.gif tags.

This way you are more likely to get a response and it will help benefit other members who may be encountering the same problem with their own code.
User is online!Profile CardPM
+Quote Post

GrahamPaul
RE: Displaying Array
22 Jan, 2008 - 12:05 PM
Post #5

New D.I.C Head
*

Joined: 9 Dec, 2007
Posts: 9


My Contributions
Thanks have this sorted now. My problem was using it on form_load. It prefers it if I use a command button to show the table.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 01:40PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month