devxlogo

Tip Bank

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

Change Dates With Plus and Minus Keys

This simple piece of code saves a lot of headaches when it comes to altering dates. It allows you to use the plus and minus keys to increment and decrement

Convert Static Variables for More Speed

Referencing a static local variable in a procedure is two to three times slower than a regular local, dynamic variable. If your procedure demands every last bit of speed possible,