Visual Basic Tip: 10/09/95

Miscellaneous Tips.
- When unloading a form, consider freeing all the resources associated
  with the form.  VB/Windows retains form level variables and form 
  properties even after a form has been unloaded.  Ex:

  Set frmMine = Nothing

- Use the BeginTrans and CommitTrans statements to speed mass updates 
  to database tables.  This allows VB to write one large chunk of data
  to disk instead of record by record.  Ex:
  Do While Not tbl.EOF
    i = i + 1
    tbl("myfield") = tbl("myfield") & Str$(i)

- In VB, only use global variables when there is no other convenient
  way to share data between forms. You may want to consider storing
  information in a control's Tag property, which can be accessed
  globally using the syntax.

- Minimize the number of times a form/object property is referenced.  
  When possible assign the property value to a variable prior to using
  the property multiple times.  This runs much faster!  Ex:

  thetop = 
  for i = 0 to 19 = thetop + i * 200 

Return to Phil's Web Page

Created by: Philip