Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckBox OnClick event doesn't activate

Status
Not open for further replies.

RobTsintas

Technical User
May 17, 2001
58
GB
Hi,

I have a form that is based on a non-updatable recordset, and has a number of checkboxes.

As the recordset cannot be updated just by clicking on the checkboxes, I have used VBA to run a line of SQL, which checks/unchecks the check box and refreshes the form.

This works fine if the VBA is in the OnClick event of a button, but if I put it into the OnClick event of the checkbox itself, it doesn't run the code (I just get the "This recordset is not updatable" message).

I tried putting the code into the GotFocus event of the CheckBox, but this causes problems with reloading the form.

Is there any way I can get the OnClick event to fire?

Thanks
 
It is probably because the checkbox is bound to a yes/no field in the recordsource in the non updateable recordset. When clicking it, it attempts to change the value in the field it's bound to, creating the errormessage.

If you wish to continue this, you will probably either need to unbind all the checbox controls, or use an updateable recordset.

Roy-Vidar
 
Thanks for the suggestions. Will keep trying!

I need the checkboxes to display the current values, so they need to be bound to something. I might try replacing them with textboxes with some wingding tick/crosses and see if that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top