Let's say I have used the button wizard to make a button that opens up my main form. I'll call it "Main_Form". In this main form, I have a subform called "Person_Responsible" , which has one combo box, which allows the user to select an employee name. The name of the combo box is "EmployeeID" and the control source is "EmployID". The control source "EmployID" links "Main_Form" table and the "Employee" table together through a junction table "Person_Respon_Jct". (This is so I can have a one to many relationship, meaning that I can assign many employees to one entry of the form.) Now have a second form, I'll call in "Second_Form". It has the button described in the first sentence of this paragraph that opens "Main_Form". I also have a combo box that allows me to select an employee name from the "Employee" table just like the combo box in the "Person_Responsible" subform. This combo box is named "Combo20".
Is it possible to use vb code like below to set the criteria so that whenever the employee name in the combo box in the "Person_Responsible" subform is the same as the employee name in "Combo20", then "Main_Form" will open up filtered only with the forms associated with that employee name in "Combo20".
stDocName = "Main_Form"
stLinkCriteria = "Something!!" = "& Me![Combo20]"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Is there any way I can place code where "Something!!" is so that "Main_Form" will open up filtered with the name selected in "Combo20"?
Thanks in advance.
Is it possible to use vb code like below to set the criteria so that whenever the employee name in the combo box in the "Person_Responsible" subform is the same as the employee name in "Combo20", then "Main_Form" will open up filtered only with the forms associated with that employee name in "Combo20".
stDocName = "Main_Form"
stLinkCriteria = "Something!!" = "& Me![Combo20]"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Is there any way I can place code where "Something!!" is so that "Main_Form" will open up filtered with the name selected in "Combo20"?
Thanks in advance.