Correct Syntax for Number Field in Email Message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bennton
    New Member
    • Aug 2013
    • 1

    Correct Syntax for Number Field in Email Message

    I created a button in an MS Access 2007 form, when pressed, emails a message that contains an ID number which is formatted as a number. Let's say the field name for the ID number is ID. What is the correct syntax for the number field, ID, so that the number is visible in the email message? A sample code follows:

    Code:
    Private Sub Command55_Click()
    DoCmd.SendObject _
        , _
        , _
        , _
        [eMailTo], _
        , _
        , _
        "Email Message Header", _
        "Your ID number is " & [ID] & ".", _
        False
    End Sub
    Last edited by Rabbit; Aug 24 '13, 12:01 AM. Reason: Please use code tags when posting code.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    Bennton,
    You can use the Format command to add formatting to your numbers.
    Code:
    Format ([ID],"#.")
    would add a decimal point after your number. You can learn lots about the Format function at http://office.microsoft.com/en-us/ac...001228839.aspx

    Jim
    Last edited by jimatqsi; Aug 23 '13, 11:11 PM. Reason: Typo

    Comment

    Working...