Clearing Check boxes

wolfwrz

New member
Local time
Today, 18:21
Joined
Jul 3, 2003
Messages
8
Help please...

I have a form that pulls records out of a table... It is a repeated form. I want to clear all the checkboxes of a certain type IE the following command.

ME.Checkbox.Value = "no"

This command works but only for the selected record on the form. I cant clear all the checkboxes of that type.

There are 3 types of checkbox data on the form but I only want to clear 1 type with the code.

Thanks in advance
 
Wolf,

To clear one of your checkboxes:

Code:
Dim dbs As Database
Dim sql As String

Set dbs = CurrentDb
sql = "Update YourTable Set CheckBox1 = 0"
dbs.Execute (sql)

Wayne
 
Check Boxes

Wayne

Thanks....

This will clear the entire table right...

What if the form when opened filters the table to a subset and I want to just clear the subset...


Thanks in advance
 
I am getting a User defined type not defined error also. It hangs on the first line.

Thanks
 
Fixed that problem now I am getting a sytax error from my lines

sql = "Update Master set IMMUNIZATION(S) = 0"
dbs.Execute [sql]

Master is the table and imm is the checkbox

Thanks
 
Wolf,

Can you post your exact code?

You have square brackets around the (sql) and
you refer to your checkbox as imm.

Wayne
 
Here is the code that I am trying to run via a button press....

Dim dbs As Database
Dim sql As String

Set dbs = CurrentDb
sql = "Update Master set EKG REQUIRED = 0"
dbs.Execute (sql)



Master is the Table EKG REQIRED is the Check Box. I am still getting the Syntax Error in Update Statment Problem.

Please Help. All I can see everything looks good but im just not sure.


Wolf
 
Solved My own problem but got new one.... I need to know how to clear multiple check boxes from the same table with one button.. IE similar proceedure but multiple check boxes
 
Wolf,

Code:
Dim dbs As Database 
Dim sql As String 

Set dbs = CurrentDb 
sql = "Update Master " & _
         "set Check1 = 0, "  & _
         "      Check2 = 0, " & _
         "      Check3 = 0"
dbs.Execute (sql) 
[/code

Wayne
 
I am having the same problem...

RunTime error 3144

Syntax error in update statement.

here is the code that I'm using

Code:
Private Sub Update_Button_Click()
Dim dbs As Database
Dim sql As String

Set dbs = CurrentDb
sql = "Update Data Entry Set Check to Print = 0"
dbs.Execute (sql)
End Sub

I have looked up the error online and in help, but haven't gotten any further. Each time I click the button and debug it, the dbs.Execute (sql) comes up yellow. Any help is appreciated!! Thanks!!!
 
When you have a field name or table name that contains spaces you must enclose the field name with brackets [My Field] or [My Table]

Jerry
 

Users who are viewing this thread

Back
Top Bottom