when the value is = *****X

mymy

Registered User.
Local time
Today, 01:00
Joined
Jun 18, 2001
Messages
16
HI
My field is a packet number and the user have to enter 5numbers with 1 letter..(ex: 11111a). I would like to be able to check if the user enter a "x" for the letter, whatever the number is...
Could somebody give me some code?
thanks in advance
Myriam
 
You could use the right() function.

dim strLetter as string

strLetter = Right([PacketNumber],1)

The value of the letter will then be stored in strLetter. Hope this helps.

Doug
 
Try using the example below to validate the user's entry using the control's "Before Update" event.

Private Sub YourControlName_BeforeUpdate(Cancel As Integer)
If Len(Me.ActiveControl) <> 6 Then
  ' give mesage that the user did not enter enough characters
  Cancel = True
Else
  If Not IsNumeric(Right(Me.ActiveControl, 1)) Then
    ' give message that the user did not enter the Alpha character
    Cancel = True
  End If
End If

HTH
RDH

[This message has been edited by R. Hicks (edited 08-03-2001).]
 

Users who are viewing this thread

Back
Top Bottom