Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Thanked 0 Times in 0 Posts

    IF/THEN statement for query results? (Access 2003)

    I am working in a seminar registration database and I'm attempting to make name tags. For most of our customers we want their full name listed first on the nametag (and it's pulling that from a "Registrant" field) and then we want their Agency Name listed below that (and it's pulling that info from a "Agency" field). The problem arises when some of the registrants and their agencies have the same name, and then it looks redundant to show both their Name and then the Agency Name right below it. Is there a way to run an IF/Then statement on the Agency Name field to say "if Agency Name is like Registrant, then leave blank"? The reason I use the word "like" is because the Agency Name will not always be EXACTLY like the Registrant name. The Registrant may be "Joseph K. Smith" and his agency may be "Joseph K. Smith, LLC".

    So...if this ISN'T possible - what is another solution?

    I've tried to export to Word and edit manually, however the export to Word messes up my nametags (takes out our company graphic, and some lines that I've added to the nametag, and NOTHING lines up right).

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Frederick, Maryland, USA
    Thanked 2 Times in 2 Posts

    Re: IF/THEN statement for query results? (Access 2003)

    Somehting like this might work IF they are basically the same as shown in your example



    (It's been a while!)

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: IF/THEN statement for query results? (Access 2003)

    In addition to Gary's reply: you could use one text box high enough to hold two lines with Control Source

    =[Registrant] & IIf([Registrant]=Left([Agency],Len([Registrant])),Null,Chr(13) & Chr(10) & [Agency])

Posting Permissions

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