Bound Checkbox

Meltdown

Registered User.
Local time
Today, 23:45
Joined
Feb 25, 2002
Messages
472
Hi everyone, I have a bound checkbox on a continuous form and I want the user to be able to select only one checkbox at a time. At the moment they can select as many as they like which is not what I want. Anyone know how to do this?

Thanks for any help
 
If you only want one checkbox then you don't want a continuous form. Or maybe you want to put the checkbox field into the form header? I am guessing at this point, be more specific...
 
Hi Treason, I do need a continuous form...I think.

The continuous form lists a number of possible report headings, the user clicks the checkbox beside the heading they want to use, and I then pull the selection into the top of the report, so I only want one checkbox to be checked.

Thanks for the reply
 
Ok, I see what you mean. I am assuming the checkbox is Unbound, meaning you do not have a yes/no field in your table. If this is the case you cannot select only 1 checkbox at a time, because that value is repeated for evey record.

Although you may be able to "cheat" your way around it. But you would have to add a yes/no field to your table.
 
Hi Treason, the checkbox is actually bound, as I was aware of the unbound checkbox problem. A bound checkbox is also necessary if I want to know which row was clicked/selected.
 
Still looking for a solution to this, if anyone has any ideas...thanks
 
Thanks a lot cbearden, that does work, but not quite as the original poster said. I had to put the code into the on_click event as opposed to Before_Update.

Regards
Meltdown
 
What u want to do is Before_update. When the user clicks on the checkbox code should run before the click to make all the checkboxs = 0 in the table, then it will check the 1 to yes check? See where I am going with this?

Code:
Private Sub Check1_BeforeUpdate(Cancel as Integer)

   DoCmd.SetWarnings False
   ' -1 means no, 0 means yes
   DoCmd.RunSQL "UPDATE MyTable SET MyTable.MyCheckField = -1;"

End Sub

This is not the neatest approach but it should work. I don't have Access in front of me, so this might not be perfect.

Cheers
 

Users who are viewing this thread

Back
Top Bottom