Acknowledge an asterisk as a string

K

kidkosmo

Hi, All,

Is there a way to have Access acknowledge an asterisk as a string
value rather than a wildcard? I would like to add validation to a
field that will not allow and asterisk to be added as part of that
field; however, the validation appears to recognize that value as a
wildcard and does not allow any value to be entered.

Thoughts, ideas?

Thanks!
 
J

James A. Fortune

Hi, All,

Is there a way to have Access acknowledge an asterisk as a string
value rather than a wildcard?  I would like to add validation to a
field that will not allow and asterisk to be added as part of that
field; however, the validation appears to recognize that value as a
wildcard and does not allow any value to be entered.

Thoughts, ideas?

Thanks!

Try:

SELECT * FROM MyTable WHERE FieldName LIKE "*[*]*";

to return records from MyTable where FieldName contains an asterisk.
Maybe NOT LIKE "*[*]*" will give the opposite.

James A. Fortune
(e-mail address removed)
 
D

david

Or, if you want that as a validation rule,

LIKE "fred[*]nurk"

applied to a textbox or table, that only accepts
fred*nurk

(david)

Hi, All,

Is there a way to have Access acknowledge an asterisk as a string
value rather than a wildcard? I would like to add validation to a
field that will not allow and asterisk to be added as part of that
field; however, the validation appears to recognize that value as a
wildcard and does not allow any value to be entered.

Thoughts, ideas?

Thanks!

Try:

SELECT * FROM MyTable WHERE FieldName LIKE "*[*]*";

to return records from MyTable where FieldName contains an asterisk.
Maybe NOT LIKE "*[*]*" will give the opposite.

James A. Fortune
(e-mail address removed)
 
J

John Spencer

If you just want to eliminate asterisks then the validation rule could be
Like "*[!*]*"
Or
NOT Like "*[*]*"
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
Or, if you want that as a validation rule,

LIKE "fred[*]nurk"

applied to a textbox or table, that only accepts
fred*nurk

(david)

Hi, All,

Is there a way to have Access acknowledge an asterisk as a string
value rather than a wildcard? I would like to add validation to a
field that will not allow and asterisk to be added as part of that
field; however, the validation appears to recognize that value as a
wildcard and does not allow any value to be entered.

Thoughts, ideas?

Thanks!

Try:

SELECT * FROM MyTable WHERE FieldName LIKE "*[*]*";

to return records from MyTable where FieldName contains an asterisk.
Maybe NOT LIKE "*[*]*" will give the opposite.

James A. Fortune
(e-mail address removed)
 

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