Checkbox dilemma

ezpc

Registered User.
Local time
Today, 15:37
Joined
Sep 7, 2000
Messages
19
Thanks in advance for any help. This forum is the best on the web!

I have a subform that contains records of student assessments. There is a checkbox that indicates the current teacher giving the assessment. The data entry person invariably forgets to check the box which affects some reports. I've tried to automate the process so that when a new record is entered, the checkbox is automatically turned on and the previous one is turned off. However, it's not working very well...locking up, etc.

Does anyone have ideas on how to approach this problem or the code to use?
 
Put this in the After Update of your text field or within the coding of an On-Click Command Button (whatever you have) to check the check box:

Forms!MyFormName![CheckboxName] = True

When you want to clear the checkbox, do the reverse using the same procedure:

Forms!MyFormName![CheckboxName] = False

If you have multiple checkboxes to either clear or mark, you would have to state each one.

Replace MyFormName and CheckboxName with your actual names.

Good luck.
 
Thanks for your response Carol. Been busy putting out other fires but now have had some time to work on this problem. I'm not having much success.

One problem is that it's a subform and when I try to run this code(after update) -
Forms!frmSLPSubform![CurrentCRT] = True
I get an error message.
"Access can't find the form "frmSLPSubform" referred to in expression."

So I changed it to reference the form and subform like this -
Forms!frmAddNewScores!frmSLPSubform![CurrentCRT] = True
and get "Access can't find the FIELD "frmSLPSubform" ..."

It's probably something stupid like bracket syntax. I hope.

Anyway, if I do get the code to work correctly, I think it's the right way to turn the checkbox on when a new record is entered but how would I get the previously checked record to turn off? The subform may have 10 records or so and I only want one checked at a time. And I want it automated. Am I asking for too much?
 

Users who are viewing this thread

Back
Top Bottom