devxlogo

April 7, 2000

Use the MsgBox Wrapper to Replace OK

Replace all MsgBox calls that display only an OK message with the following OkMsg sub. It automatically defaults the icon to vbInformation, and the title to a global constant defined

Determine the File System Type

With the advent of the FAT32 file system, you might want to use VB to determine the type of file system being used for a particular drive. This example is

Use Loop Counters Even After Looping

The value of a loop counter variable is incremented one beyond the set range when the loop is completed. For example, if you use a For i = 0 to

Reattach and Refresh SQL Links

You often need to reattach or refresh links in Microsoft Access. This code refreshes all currently linked tables to sync the attached tables with the server, then remove “dbo_” from

Link the DataField to the Recordset

The data control allows you to quickly link controls and databases; however, not only is it far from flexible compared with the database-objects coding interface, it doesn’t look great. I

Count the Occurrences of a Character or Substring

VB6 introduced the Split function, which returns a zero-based, one-dimensional array containing a specified number of substrings. Although this function is useful in itself, you can also use it in

Simplify Programatic Selection in Combos

Here’s a useful procedure to position a ComboBox according to a value of the ItemData property or the List property. It’s useful to position a ComboBox with values taken from