Results 1 to 6 of 6
  1. #1
    laavista is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    42

    Query for Report, display only if condition is met, multiple conditions


    I have a reminder table, tbl_reminders
    fields:
    Empl_ID, number (long)
    Rem_1_on, text ( 1 char)
    Date1, date (short)
    Rem_2_on, text ( 1 char)
    Date2, date (short)
    Rem_3_on, text ( 1 char)
    Date3, date (short)

    Table's data:
    Empl_ID
    Rem_1_on
    Date1
    Rem_2_on
    Date2


    Rem_3_on
    Date3
    123
    Y
    3/4/10
    N
    5/6/10
    Y
    6/7/10
    456
    N
    12/12/10
    Y
    6/1/10
    Y
    1/12/09


    I need a report that would display, for each empl_ID, ONLY the dates that have rem_#_on= 'Y'

    Example report
    Empl_ID
    Rem_1_on
    Date1
    Rem_2_on
    Date2
    Rem_3_on
    Date3
    123
    Y
    3/4/10


    Y
    6/7/10
    456


    Y
    6/1/10
    Y
    1/12/09

    I've tried various query types, but nothing is working. Your help would be greatly appreciated!

  2. #2
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40
    not sure why your table is set up the way it is. Seems like it would be more efficient to have a table that looks like this: EmployeeID, Reminder, Date, ReminderType. Where reminder type determines various reminder categories. so you would have 3 records for each one you have now. Anyway, with the setup you have described you can include an entire table as your data source and use condition statement on each textbox to check if corresponding reminder exists and if so display it, otherwise display blank. I hope that helps.

  3. #3
    laavista is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    42

    additional info

    I inherited the database, and unfortunately cannot change the structure of this particular table.

    I'd like to do the conditions, but can't seem to get it to work.

    Any suggestions?

  4. #4
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40
    For each reminder textbox (I assume you should have 3 of them) change control source property to something like this:

    =iif([Rem_1_on]="Y", [Date1], "")

    Make sure Date1 is the name of the field in the data source of the report, not the name of a textbox.
    It should give you the date only if your Rem_1_on field is set to Y, otherwise it will leave textbox blank. Let me know if you need more details. good luck!

  5. #5
    laavista is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    42

    Solved!

    You are great! This worked like a charm. I was trying to do this with a query, and it was just not working. This is EXACTLY what I needed.

    Thank you so much for taking the time to help me with this!!!!

  6. #6
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40
    glad to help!

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

Similar Threads

  1. iif statement with multiple conditions
    By ragsgold in forum Queries
    Replies: 7
    Last Post: 08-24-2011, 05:38 PM
  2. Open Report or Form depending on condition
    By jheintz57 in forum Forms
    Replies: 5
    Last Post: 03-12-2010, 08:16 PM
  3. Expression with multiple conditions
    By techexpressinc in forum Queries
    Replies: 3
    Last Post: 06-19-2009, 08:33 PM
  4. Highlighting Report Data Based on a Condition
    By KramerJ in forum Reports
    Replies: 1
    Last Post: 05-29-2009, 10:27 AM
  5. Report to display multiple records by date.
    By af01waco in forum Reports
    Replies: 1
    Last Post: 03-21-2009, 02:12 PM

Tags for this Thread

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