Results 1 to 5 of 5
  1. #1
    Sherrydahlmontee is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3

    Formatting an Unbound Control on a Report


    I have ContactName and ContactPhone fields that I want to merge in an unbound control (=[contactname] & " - " & [contactphone]) on a report...however, I store the phone# without any symbols in a text field, and I use input masks to format the phone# to look like (123) 456-7890. I can't seem to find a way to format the phone# in the unbound control. Is it possible to format just the phone number in the unbound control, or does this have to be done elsewhere? thanks for any input!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    You could set the input mask to save the punctuation.

    Or

    =[contactname] & Format([phone#], "(###) ###-####")

    BTW, advise to avoid spaces and special characters/punctuation (underscore is exception) in naming convention. Better would be PhoneNum or Phone_Num.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Sherrydahlmontee is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3
    Doesn't work...my control wants to force it to look like this =[contactname] & " - " & Format([contactphone],"(#) #-#") as soon as I leave the control. Any other ideas?

    BTW, there are no spaces or special characters in my naming convention.

  4. #4
    Sherrydahlmontee is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3
    I just stumbled on the solution...it is

    =[contactname] & " - " & Format([contactphone], "(@@@) @@@-@@@@").

    The pound # sign doesn't work because the phone number is stored as text. The @ sign works with text. Thanks for the suggestions!

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Interesting, I tested with # symbol in the Immediate window and it worked. I tested with text and number. But now that I see yours, the @ does look familiar. Glad you found the solution.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Unbound field control Problem
    By justphilip2003 in forum Programming
    Replies: 1
    Last Post: 03-20-2013, 09:10 AM
  2. Update unbound control in report based on if statement
    By echomania in forum Programming
    Replies: 6
    Last Post: 11-23-2012, 11:37 PM
  3. Unbound Text Box Formatting
    By Pam Buckner in forum Forms
    Replies: 2
    Last Post: 10-14-2011, 01:31 PM
  4. Formatting Unbound Control
    By SltPhx in forum Forms
    Replies: 12
    Last Post: 08-17-2011, 01:49 PM
  5. Replies: 1
    Last Post: 07-11-2011, 04:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums