Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make field value start with area code

Status
Not open for further replies.

hudsma1

ISP
May 30, 2019
1
US
i created a query with the requested fields from a tblClient, need the Phone field value to start with area code 716
 
All data entry should be done through a form where you can set the default value of a control to 716. I would probably store the area code in a "setup/options" table and use a little VBA code in the Open event of the form to set the default for the control.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
you should be able to do this very easily in the query builder. Right click on the phone number field and click 'Build...' and in the box that comes up put in

Code:
'716-' & [phonenumber]

where [phonenumber] is replaced by the name of your field containing the customer's phone number. Alternately, if this is a variable for each customer stored in a [zip code] field you can concatenate it together with

Code:
[zip code] & "-" & [phonenumber]

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top