I've found quite a few threads related to form/subform deletions but, haven't found anything that addresses this particular issue. And, thanks in advance for any help!
Details about how the form is set up are provided below but, here's the gist of the dilemma...I have an "Add Record" button in the main form that properly adds a new record to the subform (GoToControl, GoToRecord new, the SetValue for each of the fields in the record). I was hoping to similarly create a "Delete Record" button in the main form but, it's not working as smoothly. I tried several macro variations including the following commands (in order): GoToControl, FindRecord, SelectRecord, DeleteRecord. But, instead of deleting the single record from the subform, the entire "main" record (along with ALL subform entries) are deleted. I think it has to do with how I'm "finding" and then "selecting" the subform record but, am at a loss how to resolve it.
(Note: if I need to provide "code" for the form, I will need some direction on how to extract it from access - I generally work in design view and "code" via macros instead of VBA)
This is a form used for attendance tracking at a dog training facility. Basic form structure is as follows:
Main Form: ClassID, ClassName, ClassDate; plus 2 buttons (Add Record, Remove Record) - SingleForm View
Subform 1: DogNameBreed (combo box), OwnerName (txtbox), DogID (txtbox), ClientID (txtbox) - this subform is not linked to the main form - the selection from the combo box populates the text boxes in this subform and, when the user clicks the "Add Record" button, the DogID and Client ID from this subform (along with ClassID from Main Form) "feed" into Subform 2 - SingleForm View
Subform 2: ClassID, DogID, ClientID ("hidden" in the footer of the main form and linked to the main form via ClassID) - this subform is based on a query that is based on my Attendance Tracking table
Subform 3: DogNameBreed, OwnerName, ClientID (hidden), DogID (hidden) - since Subform 2 doesn't have dog/owner names, it's not useful to users for confirming who was in attendance - When "Add Record" button is clicked, Subform 3 DogID field is set based on the selection from Subform 1 - this form is in Continuous View and allows the user to see all the dogs added to attendance to this particular class being looked at in the SingleView Main Form
Details about how the form is set up are provided below but, here's the gist of the dilemma...I have an "Add Record" button in the main form that properly adds a new record to the subform (GoToControl, GoToRecord new, the SetValue for each of the fields in the record). I was hoping to similarly create a "Delete Record" button in the main form but, it's not working as smoothly. I tried several macro variations including the following commands (in order): GoToControl, FindRecord, SelectRecord, DeleteRecord. But, instead of deleting the single record from the subform, the entire "main" record (along with ALL subform entries) are deleted. I think it has to do with how I'm "finding" and then "selecting" the subform record but, am at a loss how to resolve it.
(Note: if I need to provide "code" for the form, I will need some direction on how to extract it from access - I generally work in design view and "code" via macros instead of VBA)
This is a form used for attendance tracking at a dog training facility. Basic form structure is as follows:
Main Form: ClassID, ClassName, ClassDate; plus 2 buttons (Add Record, Remove Record) - SingleForm View
Subform 1: DogNameBreed (combo box), OwnerName (txtbox), DogID (txtbox), ClientID (txtbox) - this subform is not linked to the main form - the selection from the combo box populates the text boxes in this subform and, when the user clicks the "Add Record" button, the DogID and Client ID from this subform (along with ClassID from Main Form) "feed" into Subform 2 - SingleForm View
Subform 2: ClassID, DogID, ClientID ("hidden" in the footer of the main form and linked to the main form via ClassID) - this subform is based on a query that is based on my Attendance Tracking table
Subform 3: DogNameBreed, OwnerName, ClientID (hidden), DogID (hidden) - since Subform 2 doesn't have dog/owner names, it's not useful to users for confirming who was in attendance - When "Add Record" button is clicked, Subform 3 DogID field is set based on the selection from Subform 1 - this form is in Continuous View and allows the user to see all the dogs added to attendance to this particular class being looked at in the SingleView Main Form