Situation:
I have a form for mothers & babies. There are two combo boxes in the header, one for selecting each. There's also a button for adding a mother. The detail section has two tabs, one for mothers, one for babies. The mothers tab is simply additional fields from the recordset. The babies tab is a subform. When the main form is first opened, all mom names appear in its combo box, all babies names appear in its box. Selecting either one sets the focus on the appropriate record in the proper tab.
Problem:
When a mother is added and its record is saved to add a new baby, the baby subform is opened. The new baby is entered and that record is added. The combo boxes show the names as expected. However, when the new baby's name is selected from the combo box, the subform opens with a blank record. When the baby's mom's name is selected, her record appears properly in the mom tab, but the baby tab is again blank. The form must be closed and reopened for the expected behavior to occur.
There must be a way to code this to get the baby record to appear correctly. I can say that requery doesn't do the trick - at least given the way I've set up the form.
I'll happily provide code as may be useful. Any and all hints or suggestions welcome.
TIA
George
I have a form for mothers & babies. There are two combo boxes in the header, one for selecting each. There's also a button for adding a mother. The detail section has two tabs, one for mothers, one for babies. The mothers tab is simply additional fields from the recordset. The babies tab is a subform. When the main form is first opened, all mom names appear in its combo box, all babies names appear in its box. Selecting either one sets the focus on the appropriate record in the proper tab.
Problem:
When a mother is added and its record is saved to add a new baby, the baby subform is opened. The new baby is entered and that record is added. The combo boxes show the names as expected. However, when the new baby's name is selected from the combo box, the subform opens with a blank record. When the baby's mom's name is selected, her record appears properly in the mom tab, but the baby tab is again blank. The form must be closed and reopened for the expected behavior to occur.
There must be a way to code this to get the baby record to appear correctly. I can say that requery doesn't do the trick - at least given the way I've set up the form.
I'll happily provide code as may be useful. Any and all hints or suggestions welcome.
TIA
George