R
rich
Hello,
I am trying to get a sub-form to refresh it's data whenever the main control
on the main frame changes its value. There should be no updates to any
values on the main form. All values in the sub-form except the FK are
candidates for updating.
My main form has a cbo and a couple text boxes. The cbo is the key to both
the text boxes and all the data in the sub form. Data in the txtboxes comes
from 1 table and represent typical name, addr, pho stuff. Data in the
subform are details from another table. The cbo is the FK to each.
This is how I built the subform.
1. Bound the form to the table and created objects (1 cbo, 3 txtboxes).
2. Built a qry to select the detail data using same FK as #1.
3. I (discovered that I could do this to build the sFrm.) dragged the qry
directly onto the form and a wizard too me through building the sub form.
I call this form from another form via cmdButton.
When the form opens, user is queried for the empID (FK). The form should
open with empID and name stuff on main form and the related details on the
subform. If user selects a differernt key from the cbo on the main, the
details on the sub-form should refresh to match the newly selected employee.
Right now, everything is displayed correctly the first time, but if I select
a new empID from the cbo, the subform does not refresh and I may get a
warning about attempted update that violates PK/FK constraints.
TIA,
Rich
I am trying to get a sub-form to refresh it's data whenever the main control
on the main frame changes its value. There should be no updates to any
values on the main form. All values in the sub-form except the FK are
candidates for updating.
My main form has a cbo and a couple text boxes. The cbo is the key to both
the text boxes and all the data in the sub form. Data in the txtboxes comes
from 1 table and represent typical name, addr, pho stuff. Data in the
subform are details from another table. The cbo is the FK to each.
This is how I built the subform.
1. Bound the form to the table and created objects (1 cbo, 3 txtboxes).
2. Built a qry to select the detail data using same FK as #1.
3. I (discovered that I could do this to build the sFrm.) dragged the qry
directly onto the form and a wizard too me through building the sub form.
I call this form from another form via cmdButton.
When the form opens, user is queried for the empID (FK). The form should
open with empID and name stuff on main form and the related details on the
subform. If user selects a differernt key from the cbo on the main, the
details on the sub-form should refresh to match the newly selected employee.
Right now, everything is displayed correctly the first time, but if I select
a new empID from the cbo, the subform does not refresh and I may get a
warning about attempted update that violates PK/FK constraints.
TIA,
Rich