- put the form in design view.
- select the button.
- view/properties.
- go to event tab.
- in the On Click event, select [Event Procedure]
- click the small box to the right (...)
- you should be in a code module for the form, and specifically in the On Click event procedure for the button.
- put the code where the cursor is (hopefully you haven't moved it).
- rename the items in red to match the names of your controls:
Me.sfrmName.Form!chkboxName = True