Add "." to user's entry if they didn't

  • Thread starter Thread starter Pamela
  • Start date Start date
P

Pamela

I have a Remarks section in my form for the user to type any additional info
pertinent to the file they are entering but it seems that about half of the
time, they don't punctuate it with a final period. Is there a way that I can
code it so that IF they didn't add that final "." that the system will? All
of the data is later concatenated together which is why it matters.

Thanks so much for any help!

Pamela
 
If Len(Me!txtRemarks & vbNullString) > 0 Then
If Right(Me!txtRemarks, 1) <> "." Then
Me!txtRemarks = Me!txtRemarks & "."
End If
End If

Of course, that won't work if they ended the remarks with an exclamation
point or a question mark...
 
In the "After Update" Event of your Remarks section, you could write
code like this:

if Right(me.remarks, 1) <> "." then
me.remarks = me.remarks & "."
end if


replace "remarks" with whatever your textbox is named. this will
check to see if the last character is a period and will add one if
not.


hope that helps!
 
Back
Top