Mobile number from 3 fields

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have a customer table that has 3 field for contact numbers, so are a
mixture of mobile number and Land line number

I would like a way to find out if any of the fields have a mobile
number so any number starting with 07 and remove any space and dispay
it in a text feild on a form

I need the mobile number for sending auto text messages

Thanks veyr much for your help
 
I have a customer table that has 3 field for contact numbers, so are a
mixture of mobile number and Land line number

I would like a way to find out if any of the fields have a mobile
number so any number starting with 07 and remove any space and dispay
it in a text feild on a form

I need the mobile number for sending auto text messages

Thanks veyr much for your help

Sure; set the control source of a textbox on the form to

=IIF([fieldname] LIKE "07*", Replace([fieldname], " ", ""), Null)

Better might be to create a normalizing query such as

SELECT ClientID, Replace([Phone1], " ", "") AS Mobile WHERE [Phone1] LIKE
"07*"
UNION ALL
SELECT ClientID, Replace([Phone2], " ", "") AS Mobile WHERE [Phone2] LIKE
"07*"
UNION ALL
SELECT ClientID, Replace([Phone3], " ", "") AS Mobile WHERE [Phone3] LIKE
"07*"

to get a tall-thin recordset of all the mobile numbers (one client might have
two such numbers...!); you can then display this query in a Subform on your
form, linked by ClientID.
 
Back
Top