Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    NY
    Posts
    113

    Unanswered: if statement in Report

    Hi,
    I have a simple report where I want to create a 'Dear Mr. or Ms. etc'
    I have a field called Sex and I wanted to know If I could create a report that determines if there should be a Mr. or Ms. on the form.
    This code seems right logically. I tried the control source but I get a syntax error.

    =Iff [Sex] = 'M" Then HeaderDear = 'Mr'
    Else
    HeaderDear ='Ms'

    I wanted to put this in an unbound textbox.
    so text1 would be 'Dear Mr/Ms. Doe'
    Last edited by Leventcos21; 10-15-04 at 00:33.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    you're pretty close....

    ="Dear " & iif([sex]="M", "Mr", "Ms") & " " & [RestOfName]
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •