Results 1 to 4 of 4
  1. #1
    cdilly17 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    4

    IIF Help!!

    Hi all, I'm an Access newbie and I've been trying to learn through shear experimentation and YouTube... Oy!

    I have a database with a "Master List" of people who are invited to two separate events on the same day, however the majority of the people are only invited to the main program and the other group is invited to the main program AND a reception. In order to keep from registering a guest for the reception who wasn't actually invited, I've inserted a column "Invited to Pre-reception?" with a yes/no box.



    Is it possible to have an IIF statement that says something to the effect of... if the box is checked, then show both events as registration options, else only show the main program event as an option??

    I'm welcoming ANY suggestions!!! Many thanks in advance!
    Best,
    Casey.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    What do you mean by "show both events as registration options" in terms of the actual displaying of data. Is this on a form? Report? MessageBox? How exactly do you want that shown to the user?

  3. #3
    cdilly17 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    4
    In a separate "Registration" table, I was going to have [Invitee Name], [Event] with a combo box list that showed: "Pre-reception" AND "Main Program" for those invited to both events OR a combo box with ONLY "Main Program" as an option for those not invited to the pre-reception. Then I'd have [Response] and [Guest].

    So, essentially, to register John Doe, I'd go into the "Registration" table, select his name from a combo box list that populates from the Master List, and then based on whether or not his "Invited to Pre-reception?" checkbox was selected, choose the event he plans to attend. If he was invited to both and is planning to attend both, then he would require two separate lines of registration. (I created it this way, because the registrant could potentially have different guests for the different events)

    I'm so new to this that I could definitely be making this way harder than it needs to be, so I need help!

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    You would be doing this on a form, as you cant have a combobox in a table. You have your master list with a field for "invitationType." You then create another table with that holds the fields "invitationTypeID" as the primary key and "invitationType" as a text field. You would have 2 records.

    1 | Main Program Only
    2 | Pre-Reception And Main Program

    With this, you simply populate the main table with a 1 in the "invitationType" field if they are invited to the Main Program only or a 2 if it is both. You can now query off that field and do whatever you want for the registration.
    iif(invitationType = 1, [whatever you want if true], [whatever you want if false])

    That would be the syntax in a query. What I would find more useful would be to use VBA to create an on-the-fly query depending on what type of registration it is. You can hit up google for more info.

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

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