I have a form where I can enter data for a single record. I also have a subform on that form that shows a datasheet of all the records. I've created VBA code that makes the datasheet highlight the selected record in the main form, or changes the record in the main form when a record in the datasheet is clicked.
I run into a problem when adding records, though. I made the datasheet a snapshot so read only with no field for a new record. When I create a new record in the single (main) form I want it to show up in the datasheet after it is saved. This works if I save the record by clicking the record marker in the single form. However, when I click into the datasheet it should automatically update the record from the single form into the list on the datasheet subform, but still move to the other record I clicked on in the datasheet. When I do a requery of the datasheet in VBA to show the record, Access seems to lose track of which record I clicked on and moves to a random record that I did not click on. I tried it in both the AfterUpdate event for the Form and OnClick event for the cells of the datasheet
Anybody know if it's possible to fix this, or a tutorial of how to make a subform operate exactly like a split form? Also whether the highlighting of a selected line in the datasheet can be disabled when adding a new record in the single form? Currently it stays on the last record in the datasheet that was selected before opening a new record.
I run into a problem when adding records, though. I made the datasheet a snapshot so read only with no field for a new record. When I create a new record in the single (main) form I want it to show up in the datasheet after it is saved. This works if I save the record by clicking the record marker in the single form. However, when I click into the datasheet it should automatically update the record from the single form into the list on the datasheet subform, but still move to the other record I clicked on in the datasheet. When I do a requery of the datasheet in VBA to show the record, Access seems to lose track of which record I clicked on and moves to a random record that I did not click on. I tried it in both the AfterUpdate event for the Form and OnClick event for the cells of the datasheet
Anybody know if it's possible to fix this, or a tutorial of how to make a subform operate exactly like a split form? Also whether the highlighting of a selected line in the datasheet can be disabled when adding a new record in the single form? Currently it stays on the last record in the datasheet that was selected before opening a new record.