
Originally Posted by
June7
That tutorial is a well-used example of a search utility.
Exactly how is the combobox used to filter subform records? Dynamic parameterized query (I NEVER use them) or code that applies criteria to form Filter property (you don't show any such code) as in the referenced tutorial?
If you want to provide db for analysis, follow instructions at bottom of my post.
I have literally posted every line of code I used. Info in this database is classified, so I can't post it unfortunately. However, here is a detailed breakdown of it:
Tables: Desktops, Laptops, Printers, Users
Forms: SearchForm, MainForm
SearchForm:
The unbound combobox named Combo25 allows the user to type the last name of a user or select from a list of all users in the Users table. In the properties for Combo25, Row Source has the following code:
Code:
SELECT Users.Username, Users.[Last Name], Users.[First Name], Users.Department FROM Users ORDER BY Users.[Last Name], Users.[First Name], Users.Department, Users.Username;
Row Source Type for Combo25 is "Table/Query".
In Properties\Events for Combo25, [Event Procedure] is listed in After Update. Clicking on the ... shows this code:
Code:
Private Sub Combo25_AfterUpdate()Me.Requery
End Sub
Fields in SearchForm like Last Name, First Name, Employee ID, etc populate based on the selection from the list of users in Combo25.
Then I created a new form called MainForm which I hope to have many forms with the same function as SearchForm. I create a Tab Control object in a blank form and drag SearchForm directly into that tab. I then am immediately prompted with the message in the picture shown in the original post. I can hit OK and then see the SearchForm embedded in MainForm, but if I go to Form View or Layout View and try to use the combo box in the embedded SearchForm, it will not populate any fields and will display this error message:

Clicking "Debug" brings us to the image I posted in Post #10. It appears to me that Me.Requery, is causing the problem. Maybe MainForm is is taking Me as itself? I have no idea. I do appreciate the help though.