var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Does anyone know a code for once a command button is pushed, it clears a checked checkbox?
Not just in the current record, but all records in the database. But only one specific check box.
so lets say I have a command buttoned named “Command1” and a checkbox named “check1”
I want by a single push of “Command1” to clear “check1” in all records.
Any help would be appreciated.
You have many ways to do that. I belive you have a tbale with a boolean field (yes/Not) for source of checkbox. I believe the easy way is:
docmd.runsql "UPDATE [YourTable] SET [FieldofCheckBox] = false"
Be carefull! Thats updates (clean) all records of table. Is better to make some criteria, if you don´t want it.
I tried that code and it didnt work...
Some message error?
Yes, that should work if your datatype is YES/NO. What datatype are you using for the checkbox column in your table ?
Sorry guys im just not good with visual basic.
The name of the command button is "command01" and the name of the checkbox is "check114" and the checkbox is Yes/NO. Also, the name of the table is "Tape Log".
Could someone please give me the code not with the names i have provided.
Sorry for the inconvenience.
I do appreciate it.
Inside the command01_click, put:
DoCmd.RunSQL "UPDATE [Tape Log] SET [FieldOfCheckbox] = False"
Maybe you misunderstand about FieldOfCheckBox. FieldOfCheckBox is not the name of checkbox. It is the field name inside your table.