Get 15 minutes of free Live Help!

Generate a random set of characters using VBA function Rnd()

This VBA function uses the Randomize() and Rnd() functions to generate a random string of characters with a specific length.  The included Microsoft Access example applies the function to a simple form that can be used to create a password.

When the MS Access database

read more

posted on: May 15, 2009 | author: Carl Connett

Convert a number to a date using VBA

This VBA procedure converts a number, in yyyymmdd format, to a regular date like mm/dd/yyyy.  For example, a number like 20090427 will get converted to 4/27/2009.


Public Function DateFromNumber(DateNumber)
' This function returns a date from the DateNumber value.
' For example, 20090109 returns 
read more

posted on: Apr 27, 2009 | author: Carl Connett

Count non-Null values across columns in a Microsoft Access record

Need to get a count of the number of columns in the results of a MS Access query that are not Null?  This VBA code will do it.


Public Function CountValues(Val1, Val2, Val3, Val4, Val5, Val6) As Integer
' This function passes back the 
read more

posted on: Mar 10, 2009 | author: Carl Connett

Live Chat Software