Area codes search

  • Thread starter Thread starter d9pierce
  • Start date Start date
D

d9pierce

Hi all,
Is there a way to take the area code from a phone number and store
that in a separate field? We do a lot of area code searches and I need
to take the first 3 numbers (AreaCode) from my phone numbers and place
that in a separate field or create a search function on my search
criteria that will only pick up the first three numbers. Is this
possible and if so any examples or advise would be great!
Thanks,
Dave
 
Left([PhoneField],3) should work for this.

Hi all,
Is there a way to take the area code from a phone number and store
that in a separate field? We do a lot of area code searches and I need
to take the first 3 numbers (AreaCode) from my phone numbers and place
that in a separate field or create a search function on my search
criteria that will only pick up the first three numbers. Is this
possible and if so any examples or advise would be great!
Thanks,
Dave
 
if you're using a form for searching, base it on a query rather than the
table, and include a calculated field in the query the returns only the area
codes, as

AreaCode: Left([PhoneNumberFieldName], 3)

if the parens around an area code are included in the field data, it's
slightly tricker, as

AreaCode: Right(Left([PhoneNumberFieldName], 4), 3)

if you don't want the user to see this field in the form, then you can set
criteria on this field, without actually showing the field in the query
output. and, of course, you can leave the field in the query output, but
simply not bind it to a control in your form, if you prefer that.

hth
 

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

Back
Top