If you simply wish to filter records displayed when you open the form, look at the WhereCondition parameter of DoCmd.OpenForm (Access help has all the info you need on this). Don't forget that a ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results