473,395 Members | 1,688 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,395 software developers and data experts.

Command button clearing checkboxes

Is there a way to code a command button on a form that will clear all "-1"
Yes/No fields on a table to show as "0"? I tried to type in: "update "InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?

Apr 27 '07 #1
8 2456
CurrentDb.Execute "UPDATE TableName SET TableName.FieldName = False;",
dbFailOnError

"HowardChr" <u33744@uwewrote in message news:7155b3d2b585b@uwe...
Is there a way to code a command button on a form that will clear all "-1"
Yes/No fields on a table to show as "0"? I tried to type in: "update
"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?

Apr 27 '07 #2
When I put this in "UPDATE InputH-1 SET InputH-1.Refrigeration = False;" I am
getting an error message that states "expected end of statement" and it
highlights the word SET. Am I doing something wrong?
UrbanSpaceman wrote:
>CurrentDb.Execute "UPDATE TableName SET TableName.FieldName = False;",
dbFailOnError
>Is there a way to code a command button on a form that will clear all "-1"
Yes/No fields on a table to show as "0"? I tried to type in: "update
"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?
Apr 27 '07 #3
Try pasting your SQL into the query design window and execute it there. If
you get no errors then the problem is probably with the VBA command you're
using (or maybe the previous line of code).

"HowardChr" <u33744@uwewrote in message news:71563ec3d9850@uwe...
When I put this in "UPDATE InputH-1 SET InputH-1.Refrigeration = False;" I
am
getting an error message that states "expected end of statement" and it
highlights the word SET. Am I doing something wrong?
UrbanSpaceman wrote:
>>CurrentDb.Execute "UPDATE TableName SET TableName.FieldName = False;",
dbFailOnError
>>Is there a way to code a command button on a form that will clear all
"-1"
Yes/No fields on a table to show as "0"? I tried to type in: "update
"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?

Apr 27 '07 #4
Poor table name choice. You should get into the habit of not using
operators or special characters or spaces in your table and field
names. Access is gakking on the '-'. Qualify the table name by
surrounding it with square brackets:

UPDATE [InputH-1] SET [InputH-1].Refrigeration = False;

On Apr 27, 11:33 am, "HowardChr" <u33744@uwewrote:
When I put this in "UPDATE InputH-1 SET InputH-1.Refrigeration = False;" I am
getting an error message that states "expected end of statement" and it
highlights the word SET. Am I doing something wrong?

UrbanSpaceman wrote:
CurrentDb.Execute "UPDATE TableName SET TableName.FieldName = False;",
dbFailOnError
Is there a way to code a command button on a form that will clear all "-1"
Yes/No fields on a table to show as "0"? I tried to type in: "update
"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?

Apr 27 '07 #5
OK.. that did work to use it in SQL inside a query. (thanks!) The only other
question I would have then is how could I do multiple lines. My specific
tabel has 9 Yes/No boxes, and I would like only one script to run when wanted.
I tried:
UPDATE [InputH-1] SET [InputH-1].Refrigeration = False;
UPDATE [InputH-1] SET [InputH-1].Damaged Product = False;
UPDATE [InputH-1] SET [InputH-1].Weather = False;
UPDATE [InputH-1] SET [InputH-1].Display = False;
UPDATE [InputH-1] SET [InputH-1].Flooring = False;
UPDATE [InputH-1] SET [InputH-1].Debris = False;
UPDATE [InputH-1] SET [InputH-1].Obsticle = False;
UPDATE [InputH-1] SET [InputH-1].Spill = False;
UPDATE [InputH-1] SET [InputH-1].Barcode Missing/Destroyed = False;

But it says characters found at the end of the sql statment. I also tried to
delete the ";"'s and put them all on one line, but that didn't work either.

UrbanSpaceman wrote:
>Try pasting your SQL into the query design window and execute it there. If
you get no errors then the problem is probably with the VBA command you're
using (or maybe the previous line of code).
>When I put this in "UPDATE InputH-1 SET InputH-1.Refrigeration = False;" I
am
[quoted text clipped - 9 lines]
>>>"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?
Apr 27 '07 #6
I did fix it... Thanks for the tid-bit.. I'm sure that will save me a
headache later.

King Ron wrote:
>Poor table name choice. You should get into the habit of not using
operators or special characters or spaces in your table and field
names. Access is gakking on the '-'. Qualify the table name by
surrounding it with square brackets:

UPDATE [InputH-1] SET [InputH-1].Refrigeration = False;
>When I put this in "UPDATE InputH-1 SET InputH-1.Refrigeration = False;" I am
getting an error message that states "expected end of statement" and it
[quoted text clipped - 7 lines]
>"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?
Apr 27 '07 #7
I figured it out. In case anyone else working on a similar issue runs into
this, I had to use the coding:
"UPDATE [InputH-1] SET [InputH-1].Refrigeration = False, [InputH-1].[Damaged
Product] = False, [InputH-1].Weather = False, [InputH-1].Display = False,
[InputH-1].Flooring = False, [InputH-1].Debris = False, [InputH-1].Obsticle =
False, [InputH-1].Spill = False, [InputH-1].[Barcode Missing/Destroyed] =
False;"

HowardChr wrote:
>OK.. that did work to use it in SQL inside a query. (thanks!) The only other
question I would have then is how could I do multiple lines. My specific
tabel has 9 Yes/No boxes, and I would like only one script to run when wanted.
I tried:
UPDATE [InputH-1] SET [InputH-1].Refrigeration = False;
UPDATE [InputH-1] SET [InputH-1].Damaged Product = False;
UPDATE [InputH-1] SET [InputH-1].Weather = False;
UPDATE [InputH-1] SET [InputH-1].Display = False;
UPDATE [InputH-1] SET [InputH-1].Flooring = False;
UPDATE [InputH-1] SET [InputH-1].Debris = False;
UPDATE [InputH-1] SET [InputH-1].Obsticle = False;
UPDATE [InputH-1] SET [InputH-1].Spill = False;
UPDATE [InputH-1] SET [InputH-1].Barcode Missing/Destroyed = False;

But it says characters found at the end of the sql statment. I also tried to
delete the ";"'s and put them all on one line, but that didn't work either.
>>Try pasting your SQL into the query design window and execute it there. If
you get no errors then the problem is probably with the VBA command you're
[quoted text clipped - 5 lines]
>>>>"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?
Apr 27 '07 #8
Try building and testing your queries in the query editor, then switch to
the SQL window to copy and past to your code window. Most of the work will
be done, all you have to do is add quotes and calculated values.Otherwise
save the query and call it by name.

"HowardChr" <u33744@uwewrote in message news:7157218fd658c@uwe...
I figured it out. In case anyone else working on a similar issue runs
into
this, I had to use the coding:
"UPDATE [InputH-1] SET [InputH-1].Refrigeration = False,
[InputH-1].[Damaged
Product] = False, [InputH-1].Weather = False, [InputH-1].Display = False,
[InputH-1].Flooring = False, [InputH-1].Debris = False,
[InputH-1].Obsticle =
False, [InputH-1].Spill = False, [InputH-1].[Barcode Missing/Destroyed] =
False;"

HowardChr wrote:
OK.. that did work to use it in SQL inside a query. (thanks!) The only
other
question I would have then is how could I do multiple lines. My specific
tabel has 9 Yes/No boxes, and I would like only one script to run when
wanted.
I tried:
UPDATE [InputH-1] SET [InputH-1].Refrigeration = False;
UPDATE [InputH-1] SET [InputH-1].Damaged Product = False;
UPDATE [InputH-1] SET [InputH-1].Weather = False;
UPDATE [InputH-1] SET [InputH-1].Display = False;
UPDATE [InputH-1] SET [InputH-1].Flooring = False;
UPDATE [InputH-1] SET [InputH-1].Debris = False;
UPDATE [InputH-1] SET [InputH-1].Obsticle = False;
UPDATE [InputH-1] SET [InputH-1].Spill = False;
UPDATE [InputH-1] SET [InputH-1].Barcode Missing/Destroyed = False;

But it says characters found at the end of the sql statment. I also
tried to
delete the ";"'s and put them all on one line, but that didn't work
either.
>Try pasting your SQL into the query design window and execute it there.
If
>you get no errors then the problem is probably with the VBA command
you're
[quoted text clipped - 5 lines]
>>>"InputH-
1" Set Chooser = 0", but am getting an error. Any ideas?

Apr 27 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ewitkop90 | last post by:
Here is my code: <SCRIPT> function transportchange(transport) { if (framenewinstall.Helpdesk.checked) framenewinstall.Helpdesk.checked=false; if (framenewinstall.CircuitNumber.checked)...
16
by: MLH | last post by:
In Access 97 and Access 2.0 applications, if a command button has the focus, the spacebar will 'PRESS" the key. How does one go about disabling this annoying BEATURE?
4
by: Ryan | last post by:
Hello, I have a standard HTML button on an aspx web form that I have set to runat server. The button is named reset1 and its tag is as follows: <INPUT id="btnReset1" style="WIDTH: 60px;...
9
by: Marc | last post by:
Okay, here's the problem - I have 3 radio buttons, and 11 check boxes (which are disabled by default). I have the javascript below which when the last radio button is clicked, enables the...
1
by: RLN | last post by:
Re: Access 2003 I found a method here in the newsgroup that works for clearing checkboxes, but don't understand a particular line of code and how it works. Here is the code: 1. Dim ctrl As...
2
by: Radu | last post by:
Hi. I have a page with the following html: __________________________________________________________ <h1>Dynamic Controls Test</h1> <hr /> <asp:TextBox ID="txtProduct1" Text="txtProduct 1"...
1
by: femtox77 | last post by:
Hi, I try to show or hide a button when I click on checkboxes. I explain better. I'm learnig to use Jquery framework. I have a page with many rows and every row has a checkbox. I wanna show a...
8
by: jmarcrum | last post by:
Hello all, i have a continuous form that displays about 1000 records and opens when I click a button. When the form opens, the user has the option of checking a checkbox that is located beside...
4
by: virk1711 | last post by:
I want to retain the state of checkboxes after the submit button has been clicked. What it is currently doing is that it is resetting the checkboxes after the submit button is clicked. My code is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.