Results 1 to 8 of 8
  1. #1
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114

    Creating SEARCH Button - Attached DBS

    Hello everyone,

    I just need someone to direct me what to do on how to create a search BUTTON to give results on the listbox after a user typing the desired keywords to search.

    As of now, the database has "On Change" property that whenever a key is pressed (from time to time; letter per letter) it automatically change. What I want is for the user to finish the word he/she wanted to search then theres a Search BUTTON to press in order to show the results.

    Attached is the database...



    And also, how to put Reset BUTTON - to reset the search box and ready for the user to type again.

    Thanks...
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    One method is with parameterized query. Review http://datapigtechnologies.com/flash...tomfilter.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    Thank you. I will try to check this out and get back to you about the outcome, maybe tomorrow.

  4. #4
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    I got the Refresh (Reset Form) partially working... partially because it will erase what the user type in the search box BUT the number of items didnt return to the original value which is 5021, instead it remains 77 after the search (located at the left bottom ; with red highlight mark)... i want to reset all - aside from leaving the search box into empty (which is working already) and the number of items will reset also that it will return to its original value which is 5021.

    i placed this code in the reset button:

    Private Sub Command59_Click()
    Me.SearchFor.Value = ""
    Me.Requery

    End Sub

    i know something is missing but i cant figure out what.

    any help is highly appreciated.... Thanks!

    By the way, I still dont have an idea right now how to create Search BUTTON in my database. the link/video you shared is about combobox which is kinda different with my database. though i got an idea about the reset function...
    Attached Thumbnails Attached Thumbnails Untitled.jpg  

  5. #5
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    ops, nevermind, i got the reset function working - all of it... I placed these codes:

    Private Sub Command59_Click()
    Me.SearchFor.Value = ""
    Me.SrchText.Value = ""
    Me.SearchResults.Requery

    Me.SearchResults = Me.SearchResults.ItemData(1)
    Me.SearchFor.SetFocus

    End Sub



    my problem now is the Search BUTTON.
    any help is highly appreciated....
    Thanks!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Doesn't matter if the input control is a combobox, listbox, or textbox, the technique works with any.

    Since you have only the one input control, don't really need a 'Search' button. The Requery can be in the textbox AfterUpdate event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    okay, will conduct several tests with this one, because i am not really good in vba but being resourceful can do wonders.... will post the outcome asap.

  8. #8
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    okay i GOT IT at last.... i just transfered the codes from OnClick to AfterUpdate and it works... wow!

    Thanks a lot June7...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating a search button
    By sevanty7 in forum Access
    Replies: 2
    Last Post: 05-06-2013, 01:09 PM
  2. creating search button
    By jimmie in forum Access
    Replies: 7
    Last Post: 12-30-2012, 08:19 PM
  3. Creating a search button for key words
    By In need in forum Access
    Replies: 10
    Last Post: 05-01-2012, 04:21 AM
  4. Creating a Report with Pages Attached
    By qbc in forum Reports
    Replies: 5
    Last Post: 01-12-2012, 01:28 PM
  5. Replies: 3
    Last Post: 01-14-2010, 08:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums