There's a bunch of issues. Mainly, AFAIK, you cannot use Me in subform reference syntax. There are 2 syntaxes for subform references; I use one to reference the form controls:
Code:
Forms!MainFormName!SubformControlName.Form!ControlName
. For subform properties such as RecordCount, I use
Code:
Forms("MainFormName").Controls("subformControlName").Form.Recordset.Recordcount
Then there is the incorrect multiple declarations. Everything whose type is not specifically declared is a variant (e.g. BagType and every one like this).
You must write BagType as String, strBagForm As String,... As written, your code may work fine, but it's risky. Access tries to interpret the needed type and treat it accordingly, but you can raise errors trying to perform operations or actions with the values.
Mainly, you need to concatenate the entire WHERE part of your sql string and use it in whatever method you want to filter the form. This can mean applying an entire sql statement (right from the word SELECT) and requerying the form, or applying a filter to a form. It looks like you are trying to build a recordsource for a form, so it has to be written like a query.
Not real important, but you don't need the Call keyword for your code.
Hope this gets you started.
Note: please use code tags and indentation for anything more than a few lines of code. I used them even for only one line because the forum will insert a space after 50 characters.
EDIT: neither of your attachments seem accessible but the database is.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.