Non-display in sub form

novoiceleft

Registered User.
Local time
Today, 21:33
Joined
Jul 4, 2004
Messages
65
Hi All

My sub form appears to work fine most of the time.

But the records in the sub form (which is a datasheet) don't display when I apply a "filter by form" on the main form ?

Any clues as to what is wrong ?

I am a beginner - it could be something quite fundamental !

NoVoiceLeft
 
Still a problem

I've still got this problem.

Can anyone help ?

NoVoice
 
What are you filtering for from the mainform? If you needed a filter on the subform, you should code for it on the subform, not on the main form.

Can you give a more detailed explanation of what you are doing?
 
The data is in 2 tables - Projects and Tasks. One Project can have many Tasks.

I have a form called Projects. Inside it I have a sub-form (in datasheet layout) which contains the tasks.

It all works OK. When I scroll through the Project forms, one by one, the Tasks sub-form correctly changes and shows the tasks connected with each Project. All the relationships seem to work fine.

However, if I apply a filter in the Projects form (on any of the fields), the tasks sub form only shows blank.

I have done some reading. I think I have to write some code somewhere which makes sure that the sub-form being displayed always matches the related Project form. But I don't know what code to write, or where to put that code.

NoVoice
 
Is the filter for a certain project you want to find?
 
If so, use a combo box with the control source of your project table. Have the combo box lookup the project you want.
 
Users will generally use "filter by form" on various fields in the Projects form in order to find particular projects or groups of projects. That part works fine as well. Its just that the sub-form of tasks (which worked previously), becomes blank, once the filter is applied.

Is my solution something to do with making sure the Tasks form being displayed is always made to relate to the projects for currently open ?

NoVoice
 
To the best of my knowledge yes. I just would have a search or "filter" combo box. That way they just type in the name of the project and it will pull up the one that they want. After that the Task subform will update to the perticular project that was selected. I hope this is what your wanting.
 
Thats what I have.

The filtering process for the Projects works OK. But, that makes the Task sub form show empty - merely as a result of having applied a filter.

I suspect (but I am a beginner) that I need some code in the Properties of the Subform that make it "always show the tasks for the Project form that is currently open".

NoVoice
 
You may need some code. Your main form will have to change the subform's Object source based on the filter you apply to the main form.

But I"m still a little confused what you mean by 'filtering a field' on the main form. Normally I don't do this, but can you zip and attach the db to a post so we can see what you mean? (Ensure you use dummy data if your records are confidential)

I'm sort of guessing here, but I think that you want the user to select more than one project at one time, and have all the records associated with those projects show in subform.
 
I was just about to zip it and attach it - but I tried it again, and its now OK !!

I've been working on this today and the problem seems to have sorted itself out for now.

Thanks guys - this website is fabulous.

NoVoice
 

Users who are viewing this thread

Back
Top Bottom