PDA

Click to See Complete Forum and Search --> : Optimization


Hutty
Apr 6th, 2000, 12:58 AM
I have an application that gets the job done. But I'm pretty sure I'm not optimizing performance. The app is an interface with Access in which I'm retrieving data into textboxes. I have 9 forms with anywhere from 30 - 100 controls on each. There are nine modules (.bas) also. It was suggested before that I may want to use resource files to store the modules and forms. I look into it, but was unable to get to first base. The forms resemble financial data in an excel spreadsheet like fashion. A variety of combination makes up each form, with corresponding module.

Any ideas or help to spruce things up would be appreciated. Thanks.

edwardo
Apr 7th, 2000, 05:40 AM
Hi...

I go some ideas for you, not sure it will fit your needs.

1.If you got a lot of TextBoxes you should consider putting Labels insted. Labels use less memory, so your form will load quicker. One way to do this is changing the Label apearence to look like a TextBox and when clicking on it the program will create a temporar TextBox for that input.
2.You can use a ListBox to move from record to record or from a group of TextBoxes to another and depanding on what Item the ListBox stands on you can send the Info to the right field or record.

Probably there are much more ways, but no one comes to mind right now.
BTW: There is a Optimization chapter in the VB help (MSDN) you should read it.

Hope it'll help you...

Edy

Jaguar
Apr 7th, 2000, 06:24 AM
Well, without seeing the application and how you've layed everything out. It could be difficult. If you want to send me the database, I could give you a greater determination of optimzing. I liked the previous posters suggestion. Plus...

If you have that many textboxes, you could try using control arrays. Remember that you can only put 256 unique controls on a form. But because the master control of a control array is the unique one of the bunch, that means you can put more than 256 controls on a form using control arrays.

For example. 100 text boxes doesn't cound towards the 256 unique controls. Only one does.

Then, you could use an Enum to manage which text box you are looking at.

For example TextBox(0), TextBox(1), Textbox(2) could be used in this way.

Type Enum MyTextboxConstants
MTC_LastName = 0
MTC_FirstName = 1
MTC_Address = 2
End Enum

TextBox(MTC_LastName).Text = "LastName"
TextBox(MTC_FirstName).Text = "FirstName"
TextBox(MTC_Address).Text = "Address"
This is just one way and as the previous 'Poster' said, this may not fit your need, but, it will save on resources (especially if you have 100 textboxes on the form.