select records

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

Guest

I want to automatically view (sort) certain records based upon 2-3 criteria
which exist in specific fields within a form. I have been using a command
button with various macro attempts, but with no success. The problem is
getting the procedure to automatically use the specific forms field data as
criteria?

I'm not a programmer and any ideas welcomed!
 
Try this --
In the header of the form put unbound textbox, combox, or listbox to enter
or select the criteria. Add a command button to requery the query that is
the record source for the form.
In the query add criteria from each of the textbox, combox, or listbox from
the form header like --
Like "*" & [Forms]![YourFormName]![YourTextBox] & "*"

If you have entered 'be' in the textbox you will get Abe, Abel, Betty, Maybe.

If you do not use the leading or trailing wildcards you will limit what you
pull.
 
Back
Top