devxlogo

August 21, 1997

Data Access Speed

When you connect to remote servers, always use tables attached to theserver through Access. This will significantly speed up your retrievaltime. Once a table is attached to a remote server,

Avoid Using Variants

Variants take more memory and it’s slower to get/set their values thanother data types. Option 1 will run slower than Option 2. Option 1: Dim iLoop As Variant For iLoop

Use the VB Knowledge Base

Get the Visual Basic Knowledge Base from Microsoft. It contains hundredsof ideas (with code samples). I use it daily to get my job done (and findout new things to try

Hiding MDI Children

MDI children can be hidden! Although VB doesn’t directly supportthis, you can use the ShowWindow API call to do so. A simple call likethis will do it: Declare Function ShowWindow

Make MDI Children Invisible on Loading

Contrary to popular belief, an MDI child does not need to be immediatelyvisible at load time. If the Visible property is set to False at designtime, the child will not

Never Have an Untrapped Error in VB

To prevent untrapped errors in VB, put an error handler in the codefor every control/form’s events. Unless you want more granularity, youwon’t need to trap errors in function or module

Load VBX/OCX/DLLs in the Windows System Directory

It’s best to load all shared (or public) VBXs, DLLs, and OCXs in theWindows system directory. Doing so prevents component conflicts betweenshared components that are loaded in the wrong places.

Quickly Evaluate an Expression or Variable

Here’s how to quickly evaluate an expression or variable: While indebug mode, use the Add Instant Watch dialog to quickly see the currentvalue of an expression in your code. Highlight

Find Lost Controls

If a control gets lost on your form, you can select it by choosingits name from the drop-down list at the top of the properties window. Setits Left and Top