View Full Version : Checkbox in query


complex
04-02-2008, 03:56 AM
Greetings to everyone,

I've been looking through the forum for this, but I've only found how to add/count checkboxes in queries, and how to make a query based on checkboxes...what I need is to add a checkbox to every result on a query, I need this in order to add the ticked items to a record table, this is, the ticked items are accomplished tasks and therefore need to be registered (in the table) and the unticked tasks weren't accomplished and therefore shouldn't be added to the registry (table). Can anyone tell me just how to add the checkbox to the query?
I would thank any help on this.

georgedwilkinson
04-02-2008, 06:14 AM
It depends on the type of the column in the underlying table.

If your underlying data type (the column in the table the query pulls from) is "Yes/No", and is set for "Check Box", all queries will automatically have a check box for the column.

complex
04-02-2008, 07:02 AM
I don't know if i explained myself correctly, the situation is this,
I create a work order with some tasks, that may or may not be accomplished.
I have a query that retrieves the tasks present on a selected work order,
(those tasks come from a table called taskstbl, and this table does not have a check box field), my objective is to analyze the tasks that appear on the results of that query, and check the tasks that were accomplished and add (append query) them to the work order record (something like workorderdetailstbl). So what I want to know is, can't I add a check box "field" to the query so that the append query "knows" what to add to the workorderdetailstbl? The check box would only have a temporary utility...if I may call it like this. Is it really necessary to have the check box field on the original table?

complex
04-03-2008, 01:38 AM
Can't someone give me a hand on this? :(

neileg
04-03-2008, 01:58 AM
What is stopping adding the field to taskstbl?

complex
04-03-2008, 02:43 AM
Do you think I should? If I don't need the checkbox field for anything else besides verification of accomplishment of task (because I won't be using this field for anything else), I thought I could just add it on the query, but at the moment I'm also trying adding the field to the taskstbl, but there I found yet another problem, I'm able to do the query without any problem, but then I'm not able to check the tasks, this is, they are all predefined as unchecked and admitting that I accomplished task X I want to check it, but I click the checkbox and it won't change its state... (I admit that this happens because what is shown by the query there is what is present in the table, and so I'm not able to change it...).
Any suggestion?

neileg
04-03-2008, 04:18 AM
Do you think I should? If I don't need the checkbox field for anything else besides verification of accomplishment of task (because I won't be using this field for anything else), I thought I could just add it on the query, Data in a query has to exist somwhere. You can do all sorts of things to the data in the query, but it doesn't 'live' in the query. So you have to use a table and you have one conveniently to hand!
but at the moment I'm also trying adding the field to the taskstbl, but there I found yet another problem, I'm able to do the query without any problem, but then I'm not able to check the tasks, this is, they are all predefined as unchecked and admitting that I accomplished task X I want to check it, but I click the checkbox and it won't change its state... (I admit that this happens because what is shown by the query there is what is present in the table, and so I'm not able to change it...).
Any suggestion?There are a number of reasons why a query may become non-updateable. The most frequent in my experience is the use of an aggregate query (Max, sum, etc.). That's because Access can't follow a unique trail back to the underlying data (as the data does not live in the query, it has to be in a table).

Rabbie
04-03-2008, 04:29 AM
This link (http://www.allenbrowne.com/ser-61.html) will tell you why a query becomes read-only

complex
04-04-2008, 02:07 AM
Thank you for your replies, it seems it might be easier to upload the database and try to explain it from there. If you can please take a look at it.

neileg
04-04-2008, 04:45 AM
So which query is the problem?

complex
04-04-2008, 05:17 AM
The problem is on the WOCloseFrm, I choose open (it should be close, but for now I'm just testing here), then I choose one aircraft, then click on the orange button (create work order), then it will open a new form with several tabs (the one that is working correctly is the first 'inspections'), and there I would like that along with all the items it showed a column of checkboxes where the user could select the ones that were accomplished so that they should be added to the WorkOrderDetailsTbl (I again refer to the fact that it may seem confusing because of the option open but is really close, this is at the moment like this because I'm testing).

georgedwilkinson
04-04-2008, 05:35 AM
I'm sorry, I'm very confused. You said you wanted a check box in a query. When Neil asked which query was giving problems you replied with a form name.

Can you re-state your business problem, indicating which object in the database is exhibiting the problem or needs the solution?

neileg
04-04-2008, 05:38 AM
Yes, OK but which query is the non-updateable one.

complex
04-04-2008, 06:06 AM
Sorry to both of you, I didn't think on how confusing the database could be to one that never saw it... :o The problem is on the WOInspectionsQry, besides all the fields I would like it to have a checkbox column, an updateable one :). Thanks for your effort on helping me.

neileg
04-04-2008, 06:44 AM
You don't seem to have all the datafiles in the upload so I can't test it. Looking at the query you mention, it appears to have no aggregate functions but it does have a group by clause. Now either Access is stripping out the aggregate function so I can't see it or you have an unnecessary group by clause. If there is an aggregate function...There are a number of reasons why a query may become non-updateable. The most frequent in my experience is the use of an aggregate query (Max, sum, etc.). That's because Access can't follow a unique trail back to the underlying data (as the data does not live in the query, it has to be in a table).If there's no aggregate function, remove the group by clause and try again.

complex
04-04-2008, 06:54 AM
Neileg, why do you say there are datafiles missing? I've removed some forms so that I could upload it but the data is all there...all the tables are in the WINGDATA.mdb file...

neileg
04-04-2008, 07:20 AM
EngineApplicabilityTbl is missing and it was causing the Linked Table Manager to halt. OK, got it now.

neileg
04-04-2008, 07:31 AM
The form properties are set to Allow Edits No. You have locked out the ability to update the data in the form.

complex
04-04-2008, 08:08 AM
So correcting this you are able to change the checkboxes?

neileg
04-07-2008, 01:48 AM
I presume so. Seems like a pretty obvious error.

complex
04-07-2008, 02:04 AM
Yes...it seems, but I'm not able to change the checkboxes even allowing edits...:confused:

I've tested the WOInspectionsAircraftFilterQry, removing the Sum and I'm not even able to edit that...I'm really not getting it...I've tested a sample, with a table that has a checkbox field and two queries, one that gets everything in the table another that filters the results of the first query based on the name and I'm able to check/uncheck without any problems...:confused:

neileg
04-07-2008, 04:00 AM
Remove the group by clause, change the HAVING clause to a WHERE and try again.

rfrick7@yahoo.com
09-01-2011, 09:34 PM
goto the query design
on the criteria, enter =True
:mad:
I am very disappointed at the replies on this page. I am a programmer
and I would never treat someone in such a manor. When someone
is seeking out knowledge, it is very disheartening to have someone
laugh in their face. I don't understand that type of phylosophy, and I never will because I don't want to understand it. It is just merely ignorance. If a person approaches another person for knowledge, and the person that is supposed to reply with an intelligent answer, if the person doesn't know the answer to the question being asked they should identify with the apparent "they don't know", and should guide the questioning person to someone that knows or atleast can help the questioning person.