Hello Everyone: I am hoping one of the gurus here will give me some help.
I have designed a form with some check boxes. I put the checkboxes there on the form so later I could use them as flags on separate reports. Just to answer a few questions, yes, the subform is properly tied to the main form and they are all bound controls...been there, done that. Now, the purpose of a check box, as I see it is to have two logical conditions (checked = logical 1 and unchecked = logical 0 ... either it is checked or it isn't. Theoretically to me, that means, I could set up a logic condition in a query which says, "querry only the information from the main form or subform which has one or the other condition)...then, build a report based on the query which will print out or show only the recordset which meets the criteria. In other words, I should be able to build a logic statement or SQL statement in the query which says, only get the information from the records which contain Checkbox1 = 0 (or Checkbox1 =1)...
without the OR condition of course.
The only problem with this is, I have been unable to get the query to do that.
Microsoft HELP is dumb on this issue. The logical 0 or 1 is the same thing as a logical Y or N based on Y/N. Yet, I cannot find anything that tells me how to build the SQL statement or logic statement in the query that successfully pools together only th data from the db that meets the logic criteria.
When I try to do this in a report, my fields come up blank and I have a single greyed out check box on the report. I have gone back to look at the properties of the checkboxes to see if there is any way I could build the expression from that vantage point, but there are no properties that I understand that directly do this.
So to condense what I have said, I have checkboxes on my subform which is tied to a form (yes, the field names and conditions are identical for both underlying tables), I want to end up with a report (query or not), which pprints out only the dataset which meets the logic condition of Y or N (0 or 1).
Can someone help me with the code or method to do this? Thank you everyone.
Jimc52
5 7137
Hello Everyone: I am hoping one of the gurus here will give me some help.
I have designed a form with some check boxes. I put the checkboxes there on the form so later I could use them as flags on separate reports. Just to answer a few questions, yes, the subform is properly tied to the main form and they are all bound controls...been there, done that. Now, the purpose of a check box, as I see it is to have two logical conditions (checked = logical 1 and unchecked = logical 0 ... either it is checked or it isn't. Theoretically to me, that means, I could set up a logic condition in a query which says, "querry only the information from the main form or subform which has one or the other condition)...then, build a report based on the query which will print out or show only the recordset which meets the criteria. In other words, I should be able to build a logic statement or SQL statement in the query which says, only get the information from the records which contain Checkbox1 = 0 (or Checkbox1 =1)...
without the OR condition of course.
The only problem with this is, I have been unable to get the query to do that.
Microsoft HELP is dumb on this issue. The logical 0 or 1 is the same thing as a logical Y or N based on Y/N. Yet, I cannot find anything that tells me how to build the SQL statement or logic statement in the query that successfully pools together only th data from the db that meets the logic criteria.
Solution: In Access the logical state for true is -1 not 1. Note: There are actually three states for a checkbox (Checked) -1, (Unchecked) 0 and (Unselected) 1.
You shouldn't come up against this problem with individual checkboxes because access defaults to 0 but look out for it in option groups.
When I try to do this in a report, my fields come up blank and I have a single greyed out check box on the report.
The aforementioned unselected state.
McCarthy: Incredible! Just incredible. I NEVER would have guessed that Microsoft would bastardize simple logic algebra like that. Although the idea is ingenious, taking into account the negative 1 as a third conditional state, it defied my logic. I programmed for years in a number of languages and I didn't run into something quite like this. Access is a different kind of animal, even in it's logic elements.
I want to thank you for telling me the correct logic states. I won't be able to check this out until Monday at work, but I sure am going to give it a try.
I would like to ask you one further question, if you can answer it. In my query, under Condition, what would you recommend being the conditional logic statement? All I can find so far is using the IiF conditional statement using the field name such as IiF("One_Is", -1) In other words, if my checkbox is TRUE (Yes Conditon) then filter for all records in the record set which meet this condition. I am not sure that I have written this correctly since I normally don't use SQL statements to do things. Do you have a recommendation?
Thanks again.
Jimc52
Jimc52,
Can you post the relevant sql of your query as it stands at the moment. Don't worry if it's not working it will just help me to understand what you need from the logic.
Mary
McCarthy: Incredible! Just incredible. I NEVER would have guessed that Microsoft would bastardize simple logic algebra like that. Although the idea is ingenious, taking into account the negative 1 as a third conditional state, it defied my logic. I programmed for years in a number of languages and I didn't run into something quite like this. Access is a different kind of animal, even in it's logic elements.
I want to thank you for telling me the correct logic states. I won't be able to check this out until Monday at work, but I sure am going to give it a try.
I would like to ask you one further question, if you can answer it. In my query, under Condition, what would you recommend being the conditional logic statement? All I can find so far is using the IiF conditional statement using the field name such as IiF("One_Is", -1) In other words, if my checkbox is TRUE (Yes Conditon) then filter for all records in the record set which meet this condition. I am not sure that I have written this correctly since I normally don't use SQL statements to do things. Do you have a recommendation?
Thanks again.
Jimc52
PEB 1,418
Expert 1GB
The construction of IIF is
IIF(Len("One_Is")>1, True, False)
In function of your regional Settings it can be also:
IIF(Len("One_Is")>1; True; False)
NeoPa 32,511
Expert Mod 16PB
The negative 1 is not the extra here (that is the 1).
Logically -1 is used because it represents 1s in all bit positions and is quite standard.
MS invented the unset state (I think) which can actually be very handy.
I'm pretty sure, though, that controls that can hold boolean values have a property which allows / disallows the new value.
You should be able to disable this mode on your controls to give what you expected.
True / False :
Any non-zero value is treated as True in VBA. This does not mean that it is treated as =True!
When writing code it is sometimes important to check : (YourValue) and NOT (YourValue)=True.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dave Smithz |
last post by:
Hi there,
A PHP application I built has a section which lists a number of members to a
club whose names each appear with a check box beside them...
|
by: Brian |
last post by:
I'm pulling what's left of my hair out. I'm trying to check a memo
field on opening a report. If the field has "value", I'd like to
change the...
|
by: James |
last post by:
I am creating a system whereby equipment is inspected. Data is
inputted into an inspection form. However, any equipment that is not
satisfactory...
|
by: Jared |
last post by:
Radio Button or Check Box and Event Procedures
I need to insert either radio buttons or check boxes onto my form. I'm
not sure which to use, or...
|
by: Jim in Arizona |
last post by:
I'm having dificulty figuring out how to process multiple check boxes on a
web form.
Let's say I have three check boxes:
cbox1
cbox2
cbox3
...
|
by: cdub100 |
last post by:
Access 2003 Windows XP
I have a form containing contact information along with 6 check boxes. I want to be able to run a report with just the...
|
by: vibee |
last post by:
this might be a simple question but how do i assign values to a check box in a query condition, i have the following so far:
Required:...
|
by: Andrew Meador |
last post by:
I have a form (Change Card List by Status) with a check box
(cboNOT) and a list box (lstStatus). There is an Open Report button
that opens a report...
|
by: eclipse93081 |
last post by:
I need a way to sum check boxes in Access. On the database interface I have 3 boxes you can check; "Scheduled/Went On", "Scheduled/Did Not Go On",...
|
by: tammygombez |
last post by:
Hey everyone!
I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
| |