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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Question in Access

Status
Not open for further replies.

ja01

Technical User
Dec 14, 2005
48
US
I have the following formula to format a zip code in a 9 or 5 digit format
IIf(Len([PZIP])>5,Format([PZIP],"00000-0000"),Format([PZIP],"00000"))
I created an update query to achieve this. The PZIP is the name of my field. Here is my question: Is there a way to automate this further using a macro? Would I still have to physically insert the name of the field? If so, how? I also want a macro to format a phone number (ie 9999999999 would look like (999)999-9999) in a macro.
I guess I want to know if it is even worth doing since I can already do this using an update query?
 
Do you need to actually change the data in the zip code and phone number fields in the underlying table, or do you just want the formatting for a report?
 
and if you are changing the data in the table, why would you want to store formatted information when it can just be formatted for display?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
to both of you. No I am not trying to change data. I simply want to format the data
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top