November 9, 2001

Test if a Character in a String is a Letter

There is a simple way to test if a character in a string is a letter.Just by using the UCase() And LCase() functions. Public Function IsLetter(Char As String) As Boolean Dim sTemp As String sTemp = Left$(Char, 1) IsLetter = (StrComp(UCase(sTemp), LCase(sTemp), vbBinaryCompare) 0) End Function Note: I use the

Change the Key for an Object in a Collection

I have created a generic function for changing the key for an object in a collection: ‘Module: Module1 Option Explicit Public Function ChangeKey(Object As Object, NewKey As String, Collection As Collection) As Boolean Dim Item As Object Dim Index As Long For Each Item In Collection Index = Index +

Loading Multiple ComboBoxes or ListBoxes from the Same Recordset

If you are loading Multiple ComboBoxes or ListBoxes from the same recordset, a fast way to do this is to only loop the recordset once.Here is a generic function that can load one ore more comboboxes at once: ‘Syntax:’ LoadCombos rsTemp, “UserName”, “UserID”, Combo1′ LoadCombos rsTemp, “UserName”, “UserID”, Combo1, Combo2′

Clear a Collection

The fastest way to clear a collection is just to set the variable to a new Collection object. However, if it’s necessary to free the references the collection is keeping, it’s faster to empty the Collection from the beginning than the end.Here is the test I used:* Create a new

Making a Clone of a Java Object

You cannot make a separate location to assign one object to another. By implementing a Cloneable interface and calling the clone() method, you can make a separate location for the same object. Implement your class with Cloneable and when you want to copy just call the clone() method. import*;import

Return the Date of the Next Specified Day of the Week

This code will return the date of the next weekday that you specify.For example, assuming today is July 4th, 2001 and you need to know the date for next Monday, the line: dDate = NextDay(Monday) will return ’07/09/2001′. Public Enum DayOfWeek Sunday = 1 Monday = 2 Tuesday = 3