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

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
 
D

Douglas J. Steele

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...
 
G

ghetto_banjo

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top