Add Checkboxes to SubForm Records

whdyck

Registered User.
Local time
Yesterday, 18:48
Joined
Aug 8, 2011
Messages
169
I'm using Access 2003.

I have a subform to which I would like to add checkboxes for the purpose of allowing the user to unassign records from the master form record. When I pull up a master record that displays the details in the subform, I want to be able to uncheck the checkboxes on records I want to unassign from the master record. Then when I click Save, I want to loop through the child records and null out the FK on those records that were unchecked. (I don't want to delete the unchecked child record, just disconnect it from the master so it can be later attached to another master record.)

But I'm not sure how to implement this. Where and how would I add a checkbox field? To a query? To the actual table? If I add an unbound checkbox to the detail band of the subform, clicking on one checkbox changes the checkbox on all records.

Any help you can give is appreciated.

Wayne
 
you add it to the table and then you create a query based on the table as record source for the subform. In that query you filter on the checkbox 'unassign' field to be false.

On the checkbox's afterupdate event you could then add the code:

private sub UnAssign_AfterUpdate()
me.requery
end sub
 

Users who are viewing this thread

Back
Top Bottom