Tip Bank

DevX

Consistent Version Numbers

For consistency’s sake, use this routine wherever your version numbers appear in code: Public Function GetMyVersion() As String ‘ Turn version info into something ‘ like “1.02.0001” Static strMyVer As

DevX

Right-Align Controls on Forms

When creating resizable forms, I like to place command buttons in either the upper-right or lower-rightcorners. For example, on data entry forms, I place record navigation buttons on the lower-left

DevX

Keep Track of the Last Form

In your MDI application, you might have many child forms and need a form to go back to the form thatcalled it. In each child form, declare this variable: Public

DevX

Val Doesn’t Work on Formatted Numbers

Beware of the Val() function. It doesn’t correctly recognize formatted numbers. Use CInt(), CDbl(), and soon instead: FormattedString = Format(1250, _ “General”) ‘ = “1,250.00”Debug.Print Val(FormattedString) ‘ prints 1 !Debug.Print

DevX

Format or Copy Diskettes Using Windows API

The Win32 API includes a pair of functions that let you format and copy diskettes from your programs: Private Declare Function SHFormatDrive _ Lib “shell32” (ByVal hwnd As Long, _

DevX

Show Free Memory Under Win32

If you want to show your users the available memory on the machine, and you’re moving from 16 bits to 32bits, you’ll find the API function GetFreeSystemResources has been dropped.

DevX

A Smart ID Generator

I wrote a unique error-proof number generator that greatly simplifies the checking of clients’ accountnumbers or other IDs used by your application. I use it in conjunction with the CheckForValid

DevX

Shelling MS Internet Mail

If you are using the new mail program that can be downloaded for free from Microsoft’s Web site, you can run it from within your program. Simply add this command