I have a form that lists an individuals demographic data and a subform for entering the individuals donations to a charity. There are 2 linked tables (Contact info and Item Donation respectively)underlying these forms. When the primary form is opened, a combo box is used to find an individuals current record. Then the subform is opened to record a new contribution. The main form is opened in add mode so I assume the subform is as well. When a new donation is entered, the forms work properly- a new record is added to the "Item Donation" table for the individual. I am stumped on an additional feature I want to add to the subform. I have 4 checkboxes on the subform to allow the user to select one of 4 designations for their contribution. I want the user to check the box for the designation they want. There is a textbox next to the checkbox that contains a string denoting the designation. As an example, one of the designations is for "capital improvements". I want that string to be placed in the field "Restricted Use" of the underlying table "Item Donations". Since their are 4 options and one "restricted use" field in the table, I have been working with recordset.edit to try to add the string value to the field when the check box is clicked. I have tried multiple permutations of the following code. I can't tell if the record I am trying to edit is the same as the record that opens when the subform opens. The code runs, but the "restricted Use" field doesn't update. If it helps, I did not use a query to set up this form/subform. The record source for the main form is "Contact info", and the record source for the subform is "Item Donation"
What am I missing?Code:Private Sub Check1_Click()Dim rst As DAO.Recordset Set rst = CurrentDb.OpenRecordset("Item_Donations", dbOpenTable) rst.Edit Text90.SetFocus rst.Fields("Restricted Use").Value = Nz((Me!Text90.Text), "") rst.Update rst.Close Set rst = Nothing End Sub
Thanks