how to search a subform/subreport

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

i have a search button on a form. it is coded so that
users can enter data into a text field and display the
results. It works fine to search the fields on my form but
i cannot figure out how to make it search my
subform/subreport
any help is appreciated
 
HI:

First off, why make a button to do this. Access has find and replace
functionality built into it. Click on a field and select from the menu
Edit/Find and a dialoque pops up for you to add the search criteria.

Secondly, a Form only displays data from a query or table. Forms
don't store data. However it is a front-end to enter data into a table.
Your second option may be to create a search form, and
name it 'Search'. It could have the unbound fields for [Username] and
[Password] so it does not over write the underlying table's 'Username'
and 'Password' fields. (These field names are just examples or course.)
In your query(ies), which display(s) the records in your main forms
or report, under the [Username] field add the criteria
form![Search]![Username]
and under the query field name [Password] add the criteria
form![Search]![Password].

If you look at the Northwind Database example it has a function called
'ISLOADED' coded and a macro. The search form has OK and Cancel buttons
which call the macro and the main form/report will have events which call
the macro. Have a look at this example as it will come in very handy.
 
Back
Top