Command Button in sub forms

  • Thread starter Thread starter Nan
  • Start date Start date
N

Nan

Is it possible to apply a find command button for an entire report (inclusive
of sub forms)? The find command button I have created only finds results
based on the main form, regarless of where I place the cursor, i.e., in a
field within a sub form. It's search results does not find a word or
character I am searching, that I know exists. Any help?

Thanks!!
 
I'm not really clear here, but I think you have a main form (not report?),
with a subform. The subform shows only the records that match the record in
the main form. You can search the subform, but it will search only the
records that are already in the subform.

If that's what you are trying to do, see:
Filter a Form on a Field in a Subform
at:
http://allenbrowne.com/ser-28.html
 
Hi Allen,

First, Thank you.

My apologies... it is a form with sub form(s). I created a find command, but
when I ask it to search for a field in any of the sub form(s) it returns a
response that no matches are found. When using the same command in the main
form it does locate the record... it doesn't seem to be working in the
sub-forms??? Hope this helps.
 
My question is:
- Is the record there in the subform to find?
- Or do you have to move to a different record in the main form before the
record will be there in the subform to find?
 
Your question is interesting.

Answer 1 to your question 1: Yes, and it still does not find it.
Answer 2 to Q 2: Regardless of the record I move to, it does not find any
known records in the sub forms.

The search only seems to work on the main form, and only the fields within
the main form.
 
You should be able to put the cursor in any text box in the subform, and use
the Find button on the toolbar to find records in the subform, provided they
are already loaded there.

If you want to write your own code to do this, use the RecordsetClone of the
form in the subform. FindFirst. Test NoMatch. Set Bookmark.
 
Back
Top