This is untested, but should be close.
Dim strInput As String, bolOkInput, i as Integer, strCheckCharacter
Do
strInput = InputBox("Please give me your input.")
strInput = Trim(strInput)
If Len(strInput) <> 4 Then
bolOkInput = False
Msgbox "Input wrong length"
Else
For i = 1 To 4
strCheckCharacter = UCase(Mid(strInput, i, 1))
If Asc(strCheckCharacter) < 65 Or Asc(strCheckCharacter) > 90
Then
bolOkInput = False
Msgbox "Not all entered characters were alpha"
Exit For
Else
bolOkInput = True
End If
Next i
End If
Loop Until bolOkInput = True
--
Wayne Morgan
MS Access MVP
<mi********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I was wondering if anyone knew of a way to control the text a user
types into an inputbox? I want the user to type in four letters only. I
can check the lenght by using the len() function in vba but I have no
idea how to check that each character is a letter. I realise I could
design a form to do this, but if the check could be done on an
inputbox, it would be so much easier.
Thanks in advance.