A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old January 7th, 2010, 07:47 PM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default Add "." to user's entry if they didn't

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
  #2  
Old January 7th, 2010, 08:11 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Add "." to user's entry if they didn't

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Pamela" wrote in message
...
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



  #3  
Old January 7th, 2010, 08:12 PM posted to microsoft.public.access.forms
ghetto_banjo
external usenet poster
 
Posts: 325
Default Add "." to user's entry if they didn't

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!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.