create a search form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dums3610
    New Member
    • Oct 2017
    • 3

    create a search form

    i have developed a small database in access 2013. i have a table (tbl_beneficiar y) with the following fields:
    1. groupid as text
    2. groupname as text
    3. Lperson as text
    4. lphoto as attachment
    etc.

    i have created a form for using this table [frm_beneficiary]. i want to create a search function within this [frm_beneficiry] to search for: lperson, groupid, lphoto, etc.
    I want to know how to use VB codes in order to perform the search function.
    please see attachment for full details.
    thanks.
    Attached Files
  • phillikl
    New Member
    • Mar 2009
    • 16

    #2
    Dums,

    Not sure the reasoning behind VBA, however if you would like to use a query to drive the form...

    Create query to drive "frm_beneficiry " with the elements you would like to see.

    Create an unbound text box control [filterText] on your search form.

    Create a cmd_button to requery results (
    Code:
     DoCmd.Requery
    )(after user puts information in the box they can launch the query).

    Under each of the desired search fields add the following to the criteria; for multiple ensure the others are in the "or" column.

    Criteria:

    Code:
    Like "*" & [Forms]![frm_beneficiry]![filterText] & "*"
    There are also a few examples that will filter the data as you type, however, I have noticed the performance quickly nose dives with medium to large databases.

    Best of Luck,
    Kendall

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32634

      #3
      Originally posted by Dums
      Dums:
      please see attachment for full details.
      That's not how it's supposed to work.

      Please read the threads explaining how properly to ask your question. It is your responsibility to express the question as clearly as you can in the thread.

      You are likely to find that very few experts have the patience download attachments just to get to where they should have been simply by opening the thread.

      I'll leave it with you to ensure any future questions are presented properly in the thread.

      Comment

      Working...