I have a form with a linked subform. It works until I use the GUI find tool (the binoculars). After doing this the subform is sometimes (but not always) empty. What's happening?
I have a form with a linked subform. It works until I use the GUI find tool (the binoculars). After doing this the subform is sometimes (but not always) empty. What's happening?
It is not finding a match to your criteria.
Yes it is. The main form displays an agreement, the subform displays accounts that are associated with that agreement. If I browse to an agreement then the subform is correctly populated. If I move to the same agreement using the binocular tool the subform is empty.
Are you searching the subform or are you searching the main form?
This may be the crux of the matter! You sound as if you mean to be searching the Main Form (Agreements) but if the focus is currently in a Control on the Subform, the search is, in fact, being run against the Subform...and is coming up empty. To search the Main Form, a Record in the Main Form has to have the focus. This might explain the 'sometimes it works, sometimes it doesn't;' depends on where the focus is when you click on the binoculars!
Linq ;0)>
No. I am clicking in a field on the parent form and using the binoculars (or any filtering tool). I think the problem arises because the field being filtered on is the one wihich links the parent and child forms.This may be the crux of the matter! You sound as if you mean to be searching the Main Form (Agreements) but if the focus is currently in a Control on the Subform, the search is, in fact, being run against the Subform...and is coming up empty. To search the Main Form, a Record in the Main Form has to have the focus. This might explain the 'sometimes it works, sometimes it doesn't;' depends on where the focus is when you click on the binoculars!
Linq ;0)>
That should be the Primary Key of the Table the Main Form is based on...which makes even less sense!
Since this occurs when you're changing Records, do you have any code in the Form_Current event?
The only other thing I can think of, especially since it's an intermittent problem, would be that you're dealing with a Form that's become corrupted.
Linq ;0)>
Yup, either it is post #2 or something is corrupt, Form, Control, File.
I have extensive code in the form_current event. Suspecting corruption I've compacted/repaired several times with no useful effect. I'll try creating a new form and see if I can replicate the problem.That should be the Primary Key of the Table the Main Form is based on...which makes even less sense!
Since this occurs when you're changing Records, do you have any code in the Form_Current event?
The only other thing I can think of, especially since it's an intermittent problem, would be that you're dealing with a Form that's become corrupted.
Linq ;0)>
Found the problem. There was a permananent filter set on the subform (no idea how it got there). I deleted that and the problem was solved.![]()