Using IIf

M

mike White

Using Access 2003, I have Table1 with fields name, Banquet50 and banquet 80
among others. Name is a text field and Banquet50 and Banquet80 are check
boxes. What I am trying to do is search the records in the table and display
the name of individuals that have Banquet50 or Banquet80 checked in a report.
I have been trying to use IIF, IS NOT NULL and OR but so far I am not having
any luck. CAn someone help me or point me in the right direction? Thanks, mike
 
R

Rick Brandt

mike said:
Using Access 2003, I have Table1 with fields name, Banquet50 and
banquet 80 among others. Name is a text field and Banquet50 and
Banquet80 are check boxes. What I am trying to do is search the
records in the table and display the name of individuals that have
Banquet50 or Banquet80 checked in a report. I have been trying to use
IIF, IS NOT NULL and OR but so far I am not having any luck. CAn
someone help me or point me in the right direction? Thanks, mike

SELECT [Name]
FROM Table1
WHERE Banquet50 = True
OR Banquet80 = True
 
M

mike White

I'm not even sure what to do with that. I was using the expression builder.
How do I use that to get a list of names that have banquet50 or banquet80
checked and then the complete record?

Rick Brandt said:
mike said:
Using Access 2003, I have Table1 with fields name, Banquet50 and
banquet 80 among others. Name is a text field and Banquet50 and
Banquet80 are check boxes. What I am trying to do is search the
records in the table and display the name of individuals that have
Banquet50 or Banquet80 checked in a report. I have been trying to use
IIF, IS NOT NULL and OR but so far I am not having any luck. CAn
someone help me or point me in the right direction? Thanks, mike

SELECT [Name]
FROM Table1
WHERE Banquet50 = True
OR Banquet80 = True
 
J

John W. Vinson

I'm not even sure what to do with that. I was using the expression builder.
How do I use that to get a list of names that have banquet50 or banquet80
checked and then the complete record?

You don't need to use the expression builder, and you don't need IIF at all.

Create a Query based on your table. Include the name field, the Banquet50
field, and the Banquet80 field (and any other fields that you want to see or
search).

On the first Criteria line under Banquet50 type

True

On the next criteria line under that (to use OR logic, since putting the
criterion on the same line would require that both boxes be checked) type
another True.

Open the query; you'll see the names that have either checkbox selected.
 
R

Rick Brandt

mike said:
I'm not even sure what to do with that. I was using the expression
builder. How do I use that to get a list of names that have banquet50
or banquet80 checked and then the complete record?

Open a new query, switch to SQL view, paste what I posted, then switch to design
view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top