Solved Subform filtered by Main Form

Dipo

New member
Local time
Today, 16:52
Joined
Jul 8, 2021
Messages
24
Hello,

I will appreciated if someone can help me to fix a problem.

I want to create a form where the list on subform is filtered by the selection on the main form.

Eg I have tables Category, Description where if in Category =Food the only option on Description will be types of food.

Thanks in anticipation.
 
You can set the master/child properties of the subform data to more than one field, separated by a semicolon.

That might achieve exactly what you want without any code involved?
 
You can set the master/child properties of the subform data to more than one field, separated by a semicolon.

That might achieve exactly what you want without any code involved?
Thanks. Will explore and revert if it helps. I actually prefer non coding solution as I am not fluent with VBA
 
Hi, thanks for the suggestion but unfortunately I couldn't resolve it.

Attached is the db. The form in question is the DATA ENTRY.

What I want to achieve is that during data entry, once a category is selected the choices of description (details) should be filtered based on the category.

Thanks.
You can set the master/child properties of the subform data to more than one field, separated by a semicolon.

That might achieve exactly what you want without any code involved?
 

Attachments

If I've understood your requirement correctly then perhaps something like this:
I have changed the Lookup field in the table "Item Description". See: http://access.mvps.org/access/lookupfields.htm
IMHO it would be better NOT to have spaces in the names given to any of the objects in Access.
Thanks for the effort it seems to be working though with a minor glitch I should be able to fix, can you please help highlight what you did differently from what I did because the relationship seems retained.

Gracias
 
AFAICR I added the Category field to the SQL statement used in the combo box on the subform and added criteria on that field.
I also added a line of code to the Got focus event so that it would requery.
 
AFAICR I added the Category field to the SQL statement used in the combo box on the subform and added criteria on that field.
I also added a line of code to the Got focus event so that it would requery.
Thanks a lot. I figured out the sql filter in the source but didn't notice the on focus. I really appreciate.
 

Users who are viewing this thread

Back
Top Bottom