Results 1 to 4 of 4

Thread: How to use Search Button on Form in Access

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    152

    How to use Search Button on Form in Access

    hi all,

    how can i use the search button on form ??

    i know that access provided inbuild search button but how can i add the condition for which that search button will work ??

    thanx in advance .
    Regards,
    Nilesh Thakur.

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to use Search Button on Form in Access

    how can i use the search button on form ??

    i know that access provided inbuild search button but how can i add the condition for which that search button will work ??
    Hi,

    What do you mean by search...What are the criterias/conditions of your search button...Please elaborate further....

    Thanks...
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    152

    Re: How to use Search Button on Form in Access

    Hi KGComputer,

    pls tell me how to search with any example from your side ...

    thanx and Regards,
    Nilesh Thakur.

  4. #4
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to use Search Button on Form in Access

    Hi,

    Here's a code snippet for a simple search using the combo box..I assume your form is bound to one table only say tblCustomer...Add some textbox which are also bound to the table...The combo box is unbound...

    In the properties change the row source type to table/query, and the row source to tblCustomer..

    Attach the code in the combo box afterupdate() event..

    VB Code:
    1. Private Sub Combo8_AfterUpdate()
    2.     ' Find the record that matches the control.
    3.     Dim rs As Object 'rs means recordset that will retrieve info in your table
    4.                            'tblCustomer
    5.     Set rs = Me.Recordset.Clone
    6.     rs.FindFirst "[Customer_ID] = " & Str(Nz(Me![Combo8], 0))
    7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    8. End Sub


    Regards,

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width