Unanswered: Filtering a form from a subform using VBA code
I have designed a form(main form) which has a record source that runs subforms. this works perfectly. I also have a macro that is attached to this subform which filters records on a different form. One of my subforms contains personnel IDs and few details. When I click on the ID field the macro runs and opens another form, filtering it by the ID number. This works when the subform is opened independently but when the subform is opened on a record source frame and you try to click on the id field you get an error message that Ms access can't find the subform referred to in a macro.
How can I filter using a code? I tried using DoCmd.penform command and it works, but I fail to come up with code that can pick the id number from the subform and opens the other form filtering it by the same ID. I need help.
okay. my mainform has an unbound frame. which when i click on a button lets say labelled employee..the unbound frame will open subform called employees in the frame. the button onClick property is attached to a code (Me!subform.sourceObject= "frmEmployees") that opens subform Employees containing empoyeeID,name and cell number..so now i want a code that when i click on employee ID in the subform the subform automatically opens another form containing all the details for that employee ID..