Hi,
I am trying to write a "[Forms]![Nameform].Filter =" a little bit more complex...
I need to filter a Form (Orders) in order to let a User only to access to his/her own orders. Tables "Orders" and "Users" are linked by a many-to-many intermediate table, "OrderUser" (with only three fields: IDOrderUser, IDOrderFK, IDUserFK). From a Dialogbox a User is selected from a combo, and then the filter in the clik event must be applied to see only the Orders from this User (thanks to the relation in the intermediate table). So I must write something like..
Take the IDUser from the combo, check the intermediate table and filter the form with all the Orders that this User have.
Puting a (forbidden) WHERE, the filter for the form would look like:
FIlter = IDOrder = IDOrderFK (From OrderUser table) WHERE: take IDOrderFK that fits IDUserFK = combo.value
IO course there are more than one order for each user. And I need the many-to-many because one order can have several Users. Until know, in all my efforts I only filtered the form to only the first order for a user.
After two weeks I think it is time to ask for some kelp...I don't even know it this can be done!
Many thanks in advance.
I am trying to write a "[Forms]![Nameform].Filter =" a little bit more complex...
I need to filter a Form (Orders) in order to let a User only to access to his/her own orders. Tables "Orders" and "Users" are linked by a many-to-many intermediate table, "OrderUser" (with only three fields: IDOrderUser, IDOrderFK, IDUserFK). From a Dialogbox a User is selected from a combo, and then the filter in the clik event must be applied to see only the Orders from this User (thanks to the relation in the intermediate table). So I must write something like..
Take the IDUser from the combo, check the intermediate table and filter the form with all the Orders that this User have.
Puting a (forbidden) WHERE, the filter for the form would look like:
FIlter = IDOrder = IDOrderFK (From OrderUser table) WHERE: take IDOrderFK that fits IDUserFK = combo.value
IO course there are more than one order for each user. And I need the many-to-many because one order can have several Users. Until know, in all my efforts I only filtered the form to only the first order for a user.
After two weeks I think it is time to ask for some kelp...I don't even know it this can be done!
Many thanks in advance.