devxlogo

Tip Bank

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

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

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

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, _

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.

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

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

Cheap Graphic Buttons

You can use the Wingdings font to put simple graphics on a standard command button. Put a standard command button on a form, and in the Properties window, change the