Coordinate status of checkbox on form to checkbox on multiple reco

D

DanRoy

I have a form where I relate one-to-many components referenced to a
ReferenceNo. Each of the "many" components has an hours value. I have a
text box on the form which automatically sums the "Many" hours values as a
sub-total from the individual hours summed from the "Many" detail records.
On the form, I have a control total from the cover sheet with the approved
hours. When the approved hours = Sum of (Many) hours, the checkbox is
checked. If the totals are not the same, then the checkbox is unchecked.

Whenever the checked staus of the checkbox changes, I want a checkbox in
each of the individual "many" records to follow the checked status of the
checkbox on the form.

All of the desired actions on the form are working as described. What does
not work follows:

In the underlying database, the records which comprise the "many" side have
a checkbox in the record structure. I want the checkbox for each of the
individual records to have the same checked/unchecked status as the checkbox
dewecribed in the first paragraph.

I have used the AfterUpdate event for the checkbox on the form to execute
this code

Check112.Value = DoCmd.OpenQuery(UpdateQuery, , acEdit)

The Update query (when executed manually) proiduces the desired but I
cannot get the event for the checkbox to trigger execution of the update
query Can you tell me whether the DoCMD format is incorrect, or am I using
the wrong event?

Update Query SQL follows:

UPDATE [BOE Update] SET [BOE Update].[DetailRecCheck] =
FORMS!BOE_Update_screen.check112
WHERE ((([BOE Update].[ReferenceNo])=[FORMS]![BOE_Update_screen].[text18]));
where text18 holds a ReferenceNo matching value

I want to set the checkboxes in the recordset to be the same as the checkbox
on the form, which indicates whether the sum of the "Many" hours equals the
sum on the top sheet of the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top