Public aCheckedWords() As Variant
'you can get a few thousand of these from the internet
Public Function getCommonWords() As String
getCommonWords = getCommonWords & "the,or,will,number,of,one,up,no,and,had,other,way,"
getCommonWords = getCommonWords & "a,by,about,could,to,word,out,people,"
getCommonWords = getCommonWords & "in,but,many,my,is,not,then,than,"
getCommonWords = getCommonWords & "you,what,them,first,that,all,these,water,it,were,so,been,"
getCommonWords = getCommonWords & "he,we,some,call,was,when,her,who,"
getCommonWords = getCommonWords & "for,your,would,oil,on,can,make,its,"
getCommonWords = getCommonWords & "are,said,Like,Now,as,there,him,find,"
getCommonWords = getCommonWords & "with,use,into,long,his,an,time,down,"
getCommonWords = getCommonWords & "they,each,has,day,I,,which,,look,did,"
getCommonWords = getCommonWords & "at,she,two,get,be,do,more,come,"
getCommonWords = getCommonWords & "this,how,write,made,have,their,,go,may,from,if,see,part"
End Function
Public Function isCommon(strWord As String) As Boolean
If InStr(getCommonWords, strWord) Then
isCommon = True
End If
End Function
Public Sub addToCheckedWords(strWord As String)
If isArrayEmpty(aCheckedWords) Then
ReDim aCheckedWords(1)
aCheckedWords(1) = strWord
Else
ReDim Preserve aCheckedWords(UBound(aCheckedWords) + 1) As Variant
aCheckedWords(UBound(aCheckedWords)) = strWord
End If
End Sub
Private Function isArrayEmpty(arr As Variant) As Boolean
Dim dblCount As Double
isArrayEmpty = True
On Error Resume Next
' CAUSES AN ERROR IF EMPTY
dblCount = UBound(arr)
If Err.Number > 0 Then Exit Function
isArrayEmpty = False
End Function
Public Function isInArray(arr As Variant, strWord As String) As Boolean
Dim intCounter As Integer
If Not isArrayEmpty(arr) Then
For intCounter = LBound(arr) To UBound(arr)
If UCase(strWord) = UCase(arr(intCounter)) Then
isInArray = True
End If
Next intCounter
End If
End Function
Public Function NameExists(strName As String) As Boolean
Dim strWhere As String
strWhere = "LastName = '" & strName & "'"
If Not IsNull(DLookup("LastName", "Employees", strWhere)) Then
NameExists = True
End If
End Function