To be brief, my situation is this: I have a main form with several text and combo boxes, as well as a subform, and the form's operations are driven by a binary option group, as follows:
If option 1 is selected, all controls are programmatically unbound, the form's recordset is dumped, and the controls are used for creating a new record. The associated subform is linked via child and master to reflect existing records that share an account number identical to that specified in one of the main form's controls. The values are inserted to the underlying table programmatically using AddNew and Update methods with a recordset.
If option 2 is selected, the main form's controls become search parameters so that the user can search for existing records (a query, essentially), and the "resultset" is reflected in the subform. To do this, the subform's child and master values are deleted, and its recordset is dynamically built based upon the values of the controls specified, once the user clicks a "Search" button. With the resulting recordset in the subform, I'd like the user to click on any record (I have an On_Current event for the subform with this) to see the record details in the controls of the main form. In other words, I'm trying to programmatically "reverse" the main form / subform relationship.
My problem is, even after explicitly giving the main form a new recordset, and after binding all the controls to fields, my controls all remain empty. My purpose of this action is to give the user the ability to edit existing records using the main form's controls - but it's not working.
Any insight here would be GREAT.
If option 1 is selected, all controls are programmatically unbound, the form's recordset is dumped, and the controls are used for creating a new record. The associated subform is linked via child and master to reflect existing records that share an account number identical to that specified in one of the main form's controls. The values are inserted to the underlying table programmatically using AddNew and Update methods with a recordset.
If option 2 is selected, the main form's controls become search parameters so that the user can search for existing records (a query, essentially), and the "resultset" is reflected in the subform. To do this, the subform's child and master values are deleted, and its recordset is dynamically built based upon the values of the controls specified, once the user clicks a "Search" button. With the resulting recordset in the subform, I'd like the user to click on any record (I have an On_Current event for the subform with this) to see the record details in the controls of the main form. In other words, I'm trying to programmatically "reverse" the main form / subform relationship.
My problem is, even after explicitly giving the main form a new recordset, and after binding all the controls to fields, my controls all remain empty. My purpose of this action is to give the user the ability to edit existing records using the main form's controls - but it's not working.
Any insight here would be GREAT.