How to ignore caption and it's field in an Access 2010 Report and an Outlook Email wh

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newtoaccessvba
    New Member
    • Oct 2012
    • 1

    How to ignore caption and it's field in an Access 2010 Report and an Outlook Email wh

    I am not too familiar with VBA in Access, but I would like if someone could show me how to ignore a caption and it's field in an Access 2010 Report and an Outlook Email when the field value is it is empty.

    'Here is some relevant code (next three lines):

    Code:
    Dim DesiredRequiredDate As String
    DesiredRequiredDate = Me!DesiredRequiredDate
    "Desired Required Date:" & " " & DesiredRequiredDate
    'In the body of email, if the value is null/empty, then I do not want the field name to appear in the body of the email, ignored.
    Last edited by Rabbit; Oct 23 '12, 05:35 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code.

    Use the If Then logic to skip blank fields
    Code:
    If someValue <> "" And Not IsNull(someValue) Then
       'output your data
    End If

    Comment

    Working...