M
magicdds
I have a form with Listbox1, Listbox2, and subform1.
Listbox2's RowSource is conditioned on the selection made in Listbox1.
The subform is linked to Listbox2 (with the link Child and link Parent
properties).
When a selection is made in Listbox1, choices come up in Listbox2. When you
make a selection in Listbox2, the appropriate record comes up in the subform
and you can edit the data in the subform.
There are two problems that I can't figure out how to fix:
1) When you first go to an existing record on the main form, and you have
not yet made a selection in either listbox, a blank record is displayed in
the subform. The user can enter data in the subform, but shouldn't be able to
because this subrecord will not be associated with choices in the listboxes.
How is this problem usually handled - preventing the user from making these
extra subrecords, by mistake?
2) When I am in a record on the main form and choose an item in Listbox1 and
then choose an item in Listbox2, the correct subrecord appears in the suform.
But then when I go to a different record in the main form, while nothing has
yet been selected in Listbox1, and therefore Listbox2 remains blank, the
subform is still displaying the data from the last record that I was on in
the main form (The subform should be blank!). I tried in the ONCURRENT
property of the main form
[Subform1].Requery
but that did nothing. How can I correct this situation?
It seems like both problems may be related. Any help would be appreciated.
Thanks
Mark
Listbox2's RowSource is conditioned on the selection made in Listbox1.
The subform is linked to Listbox2 (with the link Child and link Parent
properties).
When a selection is made in Listbox1, choices come up in Listbox2. When you
make a selection in Listbox2, the appropriate record comes up in the subform
and you can edit the data in the subform.
There are two problems that I can't figure out how to fix:
1) When you first go to an existing record on the main form, and you have
not yet made a selection in either listbox, a blank record is displayed in
the subform. The user can enter data in the subform, but shouldn't be able to
because this subrecord will not be associated with choices in the listboxes.
How is this problem usually handled - preventing the user from making these
extra subrecords, by mistake?
2) When I am in a record on the main form and choose an item in Listbox1 and
then choose an item in Listbox2, the correct subrecord appears in the suform.
But then when I go to a different record in the main form, while nothing has
yet been selected in Listbox1, and therefore Listbox2 remains blank, the
subform is still displaying the data from the last record that I was on in
the main form (The subform should be blank!). I tried in the ONCURRENT
property of the main form
[Subform1].Requery
but that did nothing. How can I correct this situation?
It seems like both problems may be related. Any help would be appreciated.
Thanks
Mark