G
Guest
Could someone help me with my problem? It seems that I can't get any of my
code to run properly in the module that I created withthe help of MS help the
code is as follows:
Option Compare Database
'**********************************
'Declarations section of the module
'**********************************
Option Explicit
'===============================================================
' The following function is named IsAlpha(). It accepts a string
' argument and returns either True (-1) or False (0).
'===============================================================
Function IsAlpha(MyString As String) As Integer
Dim LoopVar As Integer
Dim SingleChar As String
LoopVar = 1
If IsNull(MyString) Then
IsAlpha = False
Exit Function
End If
For LoopVar = 1 To Len(MyString)
SingleChar = UCase(Mid$(MyString, LoopVar, 1))
If SingleChar < "A" Or SingleChar > "Z" Then
IsAlpha = False
Exit Function
End If
Next LoopVar
IsAlpha = True
End Function
Can't seem to find out what is wrong? It give me an invalid value for the
text box? Help Please.
code to run properly in the module that I created withthe help of MS help the
code is as follows:
Option Compare Database
'**********************************
'Declarations section of the module
'**********************************
Option Explicit
'===============================================================
' The following function is named IsAlpha(). It accepts a string
' argument and returns either True (-1) or False (0).
'===============================================================
Function IsAlpha(MyString As String) As Integer
Dim LoopVar As Integer
Dim SingleChar As String
LoopVar = 1
If IsNull(MyString) Then
IsAlpha = False
Exit Function
End If
For LoopVar = 1 To Len(MyString)
SingleChar = UCase(Mid$(MyString, LoopVar, 1))
If SingleChar < "A" Or SingleChar > "Z" Then
IsAlpha = False
Exit Function
End If
Next LoopVar
IsAlpha = True
End Function
Can't seem to find out what is wrong? It give me an invalid value for the
text box? Help Please.