General discussion


'Find' on both form and subform

By Adisha ·
I have a Access 2003 form with a form and subform. Can anyone guide me on how to create a contextless find so the user can search both the form and subform. At the moment the find is defaulting to where command button or the cursor is positioned. To summarise, I would like to be able to search all fields on both form and subform.

Many thanks for your help in advance.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Adisha In reply to 'Find' on both form and s ...

Point value changed by question poster.

Collapse -

by JEPott In reply to 'Find' on both form and s ...

It's been a while since I did work in Access, but in short I believe this is what you will need to do. You will need to write some VBA for the search function to first search one form and then the next - you would probably want to search the 'current' form (the form with the focus) and then switch the focus to the next form and search it. Off the top of my head, this seems like it could end up being a lengthy sub-routine running a DO WHILE loop or something similar.

I hope that gets you pointed in the right direction.


Collapse -

by tdambra In reply to 'Find' on both form and s ...

I suggest you create a parameter query joining the two recordsources using a one-to-many join, where the parameter is the control value on the form/subform you wish to search on, and then run the query in VBA to return the record/s required...

Related Discussions

Related Forums