Subform Searching

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an access database in which a subform has been placed into a mainform. I have added the default Find button to my main form, but it only successfully searches the main form. When I click a field in the subform, and click Find, it does not find anything in the database, although I know it is there. Please help!!!!
 
Typically, a subform contains only records that relate to the record in the
main form. If that is so, then finding a record in the subform is a matter
of finding the right record in the main form first, and then moving to the
desired record in the subform.

There is a bit of code involved, but it follows these steps:
1. Use DLookup() to find the value of the foreign key in the subform's
table.

2. Find the record with that primary key value in the main form.

3. Move the subform to the desired record.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Access Newbie said:
I have an access database in which a subform has been placed into a
mainform. I have added the default Find button to my main form, but it only
successfully searches the main form. When I click a field in the subform,
and click Find, it does not find anything in the database, although I know
it is there. Please help!!!!
 
Back
Top