Validation Rule - NO COMMAS - all other characters allowed

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Trying to write a Validation Rule that will not allow commas. They mess up
my export for a bulk load spreadsheet.

Thank you.
 
Subject Line was cutoff - here is the full subject

Validation Rule - NO COMMAS - all other characters allowed
 
Either use the Instr function:

InStr([YourField],",")=0

or the Like operator:

Not Like "*,*"

In a form you can prevent the user typing a comma by putting the following
lines of code in the control's KeyPress event procedure:

Const COMMAKEY = 44

' set return value of KeyAscii argument
' to zero if comma key pressed
If KeyAscii = COMMAKEY Then
KeyAscii = 0
End If

This does not prevent a comma character being entered by other means of
course, so should be backed up with a validation rule for the column in table
design. Also the user would be given no indication why they cannot enter a
comma, so you might additionally want to call the MsgBox function within the
If….End If statement to inform the user that the character is not allowed.

Ken Sheridan
Stafford, England
 
Subject Line was cutoff - here is the full subject

Validation Rule - NO COMMAS - all other characters allowed

Ignore a aWr o nG kempf.

use the replace() function to substitute a space (or other symbol) for
the comma.

Q
 
Newbie said:
Trying to write a Validation Rule that will not allow commas. They mess
up
my export for a bulk load spreadsheet.

Setting an input mask to a lower case a, allows entry of only letters or
numbers, so if you have a 20 character text field, use 20 a's:

aaaaaaaaaaaaaaaaaaaa

See the help files for InputMask then look at the syntax and examples
 
Thanks. I modified it to:

Is Null or Not Like "*,*"

and it seems to work. Gave it a Validation Text of "No Commas Allowed" to
remind.

Thanks.
 
I'm not stupid or malicious.

The idiots around here-- that attack me with mob tactics-- _ARE_
stupid and malicious.

-Aaron
 
message
I'm not stupid or malicious.

Really? Then why were you convicted of personally threatening one of the
MVPs here? It seems to me that your conviction rate for stupid criminal
activity is significant.

Considering that you are on probation right now for some of that activity, I
would think that it is quite stupid to risk revocation of that probation.

There will come a point where your daddy can't or won't bail you out any
more. A smart person would be aware of that and act accordingly.
 
revocation? lol.

It's probation, not parole!!!

I'm just not sure you get it.

thanks

-Aaron
 
and honestly-- mob tactics.

I wasn't convicted of anything other than some kid whining to the
right pig.

It's laughable-- to take such so-called threats seriously.

Furthermore-- I'm not positive that I ever agreed that I did
anything. Personally-- I deny all of it.

Thanks

-Aaron
 
With whom are you disagreeing now? Arvin referred to probation, not parole.
It looks like he "gets it".

message

revocation? lol.

It's probation, not parole!!!

I'm just not sure you get it.

thanks

-Aaron
 
I'm unfamiliar with the terminology, so I will yield to your expertise in
this matter.

message
you can't revoke probation, kid
you _CAN_ revoke parole

-Aaron
 
I wasn't convicted of anything other than some kid whining to the
right pig.

That's what a judge is there for. To keep the police reasonably
honest.
It's laughable-- to take such so-called threats seriously.

Really? Let's let folks review your history and make up their own
mind. http://www.tonytoews.com/disruptions2007.htm
Furthermore-- I'm not positive that I ever agreed that I did
anything. Personally-- I deny all of it.

Interesting.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
BruceM said:
I'm unfamiliar with the terminology, so I will yield to your expertise in
this matter.

Probation terms violation can cause imprisonment at any time during the
period of his sentence. Just let him violate the terms of his probation and
Big Bubba may be teaching him some new terminology.
 
My advice is neither malicious or stupid.

Your mob-tactics-- hundreds of people attacking everything that I
say-- _IS_ malicious.

-Aaron
 
every judge I talked to-- agreed that they never had probable cause.

thanks

-Aaron
 
Back
Top