473,396 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cannot update checkboxes with an update query in access 97 - help!!

2
Hi,

I'm trying to use an update query to update a checkbox field in access 97.

In the update query design I am indicating in criteria:
[fieldname]=true

When I run the update query, a message box appears saying "You are about to update xxx records. .... Are you sure you want to update these?" to which I click yes.

However, when I check the table, none of the checkboxes have been updated - they are all still empty.

Can someone help me out with this - is there some issue I should be aware of when trying to update checkboxes?

Many thanks.
Mar 22 '07 #1
8 7950
ADezii
8,834 Expert 8TB
Hi,

I'm trying to use an update query to update a checkbox field in access 97.

In the update query design I am indicating in criteria:
[fieldname]=true

When I run the update query, a message box appears saying "You are about to update xxx records. .... Are you sure you want to update these?" to which I click yes.

However, when I check the table, none of the checkboxes have been updated - they are all still empty.

Can someone help me out with this - is there some issue I should be aware of when trying to update checkboxes?

Many thanks.
Your Criteria states that [fieldname]=True which would return all values which are Checked (Yes) but you state that the Check Boxes are still empty. I'm lost.
Mar 23 '07 #2
rch2
2
Your Criteria states that [fieldname]=True which would return all values which are Checked (Yes) but you state that the Check Boxes are still empty. I'm lost.
Sorry, I meant to say that I have typed in the 'Update to:' section, not the 'criteria' section. So:

All checkboxes are currently empty (ie: FALSE).

I want to update them all to checked (ie: TRUE).

In the update query design I have the following:
Update to: [fieldname]=TRUE
Criteria:FALSE

When I run this, it tells me it is updating all records, but when I go to the table none of the boxes are checked.

hope that makes sense !!
Mar 23 '07 #3
brynne
13
Hi

I think you need to select the field you want to update twice (side by side, so to speak). In the first instance you show the criteria for the update, and in the second you show the update to.

B
Mar 23 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
Sorry, I meant to say that I have typed in the 'Update to:' section, not the 'criteria' section. So:

All checkboxes are currently empty (ie: FALSE).

I want to update them all to checked (ie: TRUE).

In the update query design I have the following:
Update to: [fieldname]=TRUE
Criteria:FALSE

When I run this, it tells me it is updating all records, but when I go to the table none of the boxes are checked.

hope that makes sense !!
Do me a favour because I think your syntax is wrong here. Change the query view to SQL and copy and paste it in here.

Mary
Mar 25 '07 #5
missinglinq
3,532 Expert 2GB
This drove me crazy, because I couldn't get it to work either! Finally figured it out. Checkboxes can have one of three separate formats; Yes/No, True/False and On/Off! The trick is that in the Query Grid, your Update To and Criteria have to match the format you've set in your table!

If in your table definition your field is defined as True/False then in your query:

Criteria False
Update to True

but if your field in the table design view is defined as Yes/No (which is the default) then you have to use

Criteria No
Update to Yes

So you need to go into the Design View for you table and see what format your checkbox field has and match it up in the query!
Mar 25 '07 #6
ADezii
8,834 Expert 8TB
This drove me crazy, because I couldn't get it to work either! Finally figured it out. Checkboxes can have one of three separate formats; Yes/No, True/False and On/Off! The trick is that in the Query Grid, your Update To and Criteria have to match the format you've set in your table!

If in your table definition your field is defined as True/False then in your query:

Criteria False
Update to True

but if your field in the table design view is defined as Yes/No (which is the default) then you have to use

Criteria No
Update to Yes

So you need to go into the Design View for you table and see what format your checkbox field has and match it up in the query!
That is a great point to know - Thanks.
Mar 25 '07 #7
missinglinq
3,532 Expert 2GB
One of the reasons I love Access, despite all its many quirks, and cruising this forum, is that there's always something new to learn about it!
Mar 25 '07 #8
MMcCarthy
14,534 Expert Mod 8TB
This drove me crazy, because I couldn't get it to work either! Finally figured it out. Checkboxes can have one of three separate formats; Yes/No, True/False and On/Off! The trick is that in the Query Grid, your Update To and Criteria have to match the format you've set in your table!

If in your table definition your field is defined as True/False then in your query:

Criteria False
Update to True

but if your field in the table design view is defined as Yes/No (which is the default) then you have to use

Criteria No
Update to Yes

So you need to go into the Design View for you table and see what format your checkbox field has and match it up in the query!
Just one addition to this. If you put -1 for True or Yes and 0 for False or No it will work.
Mar 25 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ralph Smith | last post by:
I'm having trouble copying a database to another machine. Here are the two table's in ths database and the sql commands: DROP TABLE IF EXISTS `clients`; CREATE TABLE `clients` ( `client_id`...
4
by: meyvn77 | last post by:
Im using an ADP to connect to a SQL Sqever DB. In access it was really easy to say Inner join on table1 and table2 and update columnA from table1 with columnC from table2 where table1.key =...
3
by: fuimens | last post by:
Hi, With mysql-4.0.20, I have a problem inserting data with foreign key references, MySQL saying ERROR 1216: Cannot add or update a child row: a foreign key constraint fails The message is...
1
by: syl | last post by:
Hi I have a huge loto data and i am trying to come up with the total count of all total combination...the manual process to tiring in excel. e.g the possible combinations range from 1 up to 49. so...
1
by: nitinkhare1 | last post by:
Please help,I'm very frustated. when I ADD the data in kn_history_question table of htbase_tst database....it giving the error "Cannot add or update a child row:a foreign key constraint...
3
by: RAG2007 | last post by:
I'm using the QueryDef and Execute method to update a record in my MySQL backend. Problem: When the Passthrough update query is defined using QueryDef, it becomes a select query, and I cannot use...
14
by: sarabonn | last post by:
hallo Iam trying to insert a row into a access database using visual c# and iam getting an error " cannot open the action query". here is my code private void button1_Click(object sender,...
3
by: yappy77 | last post by:
The following is my IIF statement in my query: BuyerName:...
6
semanticnotion
by: semanticnotion | last post by:
Hi sir i want to transform the data of one table into another through foreign key but the following error come to my browser Here is my code and data base structure. CREATE TABLE IF NOT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.