D
Dudley
I have a form where if Type1 = 1, the user must enter the first three letters
of the town of birth in Data1. Following previous helpful advice, I have code
which requires the user to enter only alpha characters, but I have found that
this only works to check the first character. Can anyone advise how I can
check all three?
If Forms![Director1 John]![Director1Type1] = "1" And _
(Forms![Director1 John]![Director1Data1] < Chr$("65") Or
Forms![Director1 John]![Director1Data1] = Chr$("91") _
Or Forms![Director1 John]![Director1Data1] = Chr$("92") Or
Forms![Director1 John]![Director1Data1] = Chr$("93") _
Or Forms![Director1 John]![Director1Data1] = Chr$("94") Or
Forms![Director1 John]![Director1Data1] = Chr$("95") _
Or Forms![Director1 John]![Director1Data1] = Chr$("96") Or
Forms![Director1 John]![Director1Data1] > Chr$("122")) Then
fnErrorCheck = False
MsgBox "Invalid town of birth"
Exit Function
Else
fnErrorCheck = True
End If
Thanks for any help.
Dudley
of the town of birth in Data1. Following previous helpful advice, I have code
which requires the user to enter only alpha characters, but I have found that
this only works to check the first character. Can anyone advise how I can
check all three?
If Forms![Director1 John]![Director1Type1] = "1" And _
(Forms![Director1 John]![Director1Data1] < Chr$("65") Or
Forms![Director1 John]![Director1Data1] = Chr$("91") _
Or Forms![Director1 John]![Director1Data1] = Chr$("92") Or
Forms![Director1 John]![Director1Data1] = Chr$("93") _
Or Forms![Director1 John]![Director1Data1] = Chr$("94") Or
Forms![Director1 John]![Director1Data1] = Chr$("95") _
Or Forms![Director1 John]![Director1Data1] = Chr$("96") Or
Forms![Director1 John]![Director1Data1] > Chr$("122")) Then
fnErrorCheck = False
MsgBox "Invalid town of birth"
Exit Function
Else
fnErrorCheck = True
End If
Thanks for any help.
Dudley