borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Filtering a DataGridView) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Receiving "Out of memory" error message
Poster Message
iliekater
Level: Master

Registered: 04-02-2005
Posts: 125

icon Receiving "Out of memory" error message

Recently I got the "Out of memory" error message while editing and running a VBA form . I pressed Help and was provided with the possible causes , but I don't think I run in one of them . What I did observed however , is that this seems to happen becouse - as I suspect - I may have reached a maximum number of controls on the current form . Nevertheless , this is not absolute , since I observed that if I add carefully controls on the form , this doesn't always happen . You see , I add controls on that form by copying them from other forms and pasting them on the current one . So , if I copy the controls one by one instead of 10 together each time , I managed to add around 50 more controls (it's about image controls) ,, but it seems that it doesn't work anymore ... Now the error message shows up even if I copy the controls one by one ... Let me also specify here that it doesn't seem to be any controls having the same name (which should result in errors) .
So , I wonder if it is possible to add even more cotrols in the form without keep running out of memory ( ! ) .

[Edited by admin on 24-10-2007 at 04:24 PM GMT]

20-10-2007 at 12:08 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1620
icon Re: Receiving "Out of memory" error message

In VB you're allowed 256 (give or take) controls based on a few sites I found, some say VBA is allowed around 1000 or so, others said they can handle up to 16,000.  

Considering everything however, if a form actually uses that many controls, you probably need to redesign the form, or just break it into numerous smaller ones.


Since you mentioned image controls -- unless you have multiple images all visible at the exact same time, you could use just one control and change the displayed image.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

20-10-2007 at 07:46 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
iliekater
Level: Master

Registered: 04-02-2005
Posts: 125
icon Re: Receiving "Out of memory" error message

Well I devided my form into two smaller ones as you adviced me .

24-10-2007 at 01:08 PM
View Profile Send Email to User Show All Posts | Quote Reply
tutorialjcw
Level: Trainee

Registered: 08-11-2007
Posts: 1
icon Re: Receiving "Out of memory" error message

look  

____________________________
http://tutorial.jcwcn.com
Directory of tutorials for software programs such as MS Excel、photoshop and Macromedia Dreamweaver.

08-11-2007 at 01:19 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Receiving "Out of memory" error message
Next Topic (Filtering a DataGridView) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder