filter by selection?

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

Guest

i have a textbox, and a command button on a form, along with a subform.

is it possible to make it so the content in the textbox acts as criteria for
a "filter selection method" which can be executed when i click the command
button?



i am making a GUI, so making a clearly marked button would be more user
friendly than explaining how to do all this filtering, so i was hoping i
could link it to a button
 
If you want to filter the records on the subform using the text box, then on
the recordsource of the sub form add the filter
Select * From MyTable Where MyField = Forms![MainFormName]![Fieldname]
===================================================
If you want to filter on a part of a field then
Select * From MyTable Where MyField Like "*" & Forms![MainFormName]!
[Fieldname] & "*"
===================================================
When you click the button, run the code
Me.SubFormName.Requery
 
Back
Top