Does a field have a number?

S

Sean G.

Hello,

I would like to do an "If else" in code and see if a
field has a number in it. Is there anyway to do that?

Thanks,

Sean
 
A

Allen Browne

Try:
If IsNull(Me.[SomeField]) Then

If preferred, you could test for IsNumeric().
 
S

Sean G.

Those won't work because isNumeric will return a false
either way. Here is my situation, i want to see if a
field has any number in it. So I want it to return false
if it is "xxx", and true if it is "xxx45". isNumeric
would return false either way. thanks.



-----Original Message-----
Try:
If IsNull(Me.[SomeField]) Then

If preferred, you could test for IsNumeric().

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
I would like to do an "If else" in code and see if a
field has a number in it. Is there anyway to do that?


.
 
A

Allen Browne

Ah: you want to know if the Text field contains any digits at all?

If [SomeField] Like "*[0-9]*" Then
 

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