Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show what is checked off

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
My database has a few fields that are checkboxes.

i.e.: Exhibitor; Participant; Exhibitor Spouse; etc.

I want to know if there is a way to display which check box is selected in a report. This report is based on a query. So I guess what I'm asking is can this query be set up so that it will giv me the info (label name) for the checkbox that is selected.

I'm not good at programming so I do very little with the direct code.

Thank you for your input.

Sharon
 
Hi cheyenne,

On your report, make the textboxes that you want to display the info 'unbound'. i.e. recordsource is empty.

In each recordsource then type this:

=iif([exhibitor],"YES","NO")

Which basically states: IF the EXHIBITOR field is TRUE then place the word "YES" in me, otherwise place "NO.

Obviously changing [exhibitor] for the relevant field name in your table.

ATB

Darrylle







Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Are these options (Exhibitor; Participant; Exhibitor Spouse;) part of an option group bound to a single field or do you have multiple fields? HINT: if only one can be selected then a single field is ideal. If multiple then you should have a related junction table.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Darrylle,

Do I need to create an unbound text box for each one or can I create just one (which is what I prefer) and put in several if,then statements into that one unbound text box.

dhookom,

The fields are multiple fields. You can select more than one.

PHV,

Going to check that out right now.

Thank you all for your help.
 
Darrylls.

Is there a way to do a nested control source.

=iif([exhibitor],"Exhbitor",iif p[Participant],"Participant",no)

Something like that, but I know that one does not work. I have several choices that might be selected (8 different possible checkboxes)

Sharon
 
Cheyenne,

What would you want displayed if 2 are selected - in such an 'iif' statement?

ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
You're right. I hadn't thought about that.

hmmmm Guess I just need to choose the more important one and have that one display. I think that will work. I don't need to know if they are a Participant and a Board member. I think just Participant will work.

But is this something that can be done?

 
If a single person can be two things then you need another table or two. Did you read the fundamentals document PHV linked for you?

tblPerson
PersonID
Name
Address
(everything about the person)

tblTypes
TypeID
TypeName (spouse, exhibitor, board member)

PersonTypes
PersonID
TypeID

This will allow each person to be all types. A single person could be listed as both exhibitor and board member.

This is how a many-to-many relationship is established.



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Nope LesPaul,

Cheyenne wants to display the ONE checkbox indicated value (label) LOL.

OK:

One textbox on your report - not bound to a field in the query (e.g. recordsource is empty).

In the recordsource of this textbox type this:

Code:
iif([chkExhibitor], "Exhibitor",iif ([chkParticipant],"Participant", iif([chkExhibitor_Spouse],"Exhibitor Spouse","")))

'chkExhibitor, chkParticipant etc' is the name of the field in the query that holds these values, and only one of these must be able to be selected by the user.

Also, IIF works like this:

Code:
iif([field] = value   ,  use this   ,   use that )

iif([field] = value THEN use this  ELSE use that )


ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
darrylle said:
Nope LesPaul,

Cheyenne wants to display the ONE checkbox indicated value (label) LOL.

that's not what I read into:

cheyenne said:
Guess I just need to choose the more important one and have that one display.

This indicates that ONE person could have MANY role types. If Cheyenne wants to have a normalized database that won't require major reworking when the customer says, "Oh, we need to know which are participants AND also Board members."

If a properly normalized solution is implemented now, then in the future when that request is made, it will be easy to make the modifications.


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Hmm,

Ignore my last post - we have 'sync' problems here - I didn't see Cheyenne's post agreeing with my statement; only LesPauls.

Sorry,

Darrylle


Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Cheyenne,

First refer to DHookum's statement at the start, then perhaps to PHV's and LesPauls.

You really should, if you are to understand how to implement what you want to do.

ATB

Darrylle



Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Cheyenne,

Have a look at PHV's (as furkin usual).[evil]

You are not exactly clear on WHAT you want, you must first understand what is possible with data, before you can decide on your options.

ATB

Darrylle




Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top