Nested sub form control value problems

steveflanuk

New member
Local time
Today, 06:37
Joined
Mar 2, 2007
Messages
6
All

I have a main form (frm_main) in which I have a subform as a datasheet (frm_sub1).

In the first sub form I have a second (nested) subform (frm_sub_sub2) as a datasheet as well.

On the main form I have an unbound text box which gives me the value of the ID field in the nested subform (frm_sub_sub2).

In the main this works well, however, I hit a problem at a particular point.

If I expand an entry in the first subform (frm_sub1), then, in the main form (frm_main) I get the first ID value from the corresponding records in the nested subform (frm_sub_sub2) as expected, which then changes as I scroll through the expended records.

However, if I then expand another entry in the first subform (frm_sub1) without collapsing the previous entry, the ID value shown on the main form (frm_main) from the nested subform (frm_sub_sub2) remains the same and doesn't change to the currently selected record. Even if I then collapse the first selected entry on frm_sub_sub2 - the original ID value still remains on the main form (frm_main).

Any ideas on what to do with this at all? I think I've searched everything and have tried all kinds of things but nothing seems to work.
 
Just to give you an idea of what I am talking about.

If you open up frm_main, you will see a subdatasheet listing the different surnames held in tbl_individuals (via the query qry_surnames).

If you expand 'Bloggs' to see the 2 records in the nested subdatasheet, then you can see the current individual ID field at the top of frm_main showing 1, which changes to 3 if you move down.

If you then collapse the 'Bloggs' and expand one of the other names, then the Current Individual ID field at the top changes to the correct value.

However, if you leave the 'Bloggs' expanded and expand any of the other names, the Current Individual ID remains the same even when a non-'Bloggs' record is selected - and it is this problem I am trying to resolve.
 

Attachments

Users who are viewing this thread

Back
Top Bottom