Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32

    Search box that shows result in Form

    Here's a description of what Im trying to do.

    Currently I use a vendors website to search for products by description and brands to gather data such as part number, price and availability. This data is then used to create a new entry in my table.

    My vendor has supplied me with an excel file with all the info I need but need a quick way to sort through it.

    What would be Ideal is to create a form that had a quick search function on the top half that showed my search results that would help me fill out the bottom half.

    I have two columns to search through Description and Band. Here is an example

    JACKET CONTRA SLATE MD | Icon


    My problem is that I have little to no experience with coding so Ive been looking for some example to base this off.



    Any advice would be greatly appreciated!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Set up the form as Continuous View. Put unbound search controls in the Header section.

    Options:

    1. parameterized query, review http://www.datapigtechnologies.com/f...tomfilter.html

    2. VBA code that builds filter criteria string and applies to the form Filter property, review http://www.allenbrowne.com/ser-62code.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
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Sorry I might of miss represented what Im after. Im trying to search from the Main form to a subform. At this point Ive tried to rework several examples that Ive found on other forums with no luck. Im sure Im missing something small.
    I think what would be ideal is A search box that I can type a general search in and also have a Combo box that will narrow down the brand.
    example:

    Search: Jacket Brand: Icon

    results
    ||||||||||Item|||||||||||||Brand
    JACKET CONTRA SLATE MD | Icon

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Still think the referenced links are relevant.

    Here's another http://www.datapigtechnologies.com/f...combobox2.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.

  5. #5
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Awesome thanks for the help, I managed to get the combobox created and working but sense I sell many items of the same brand my combobox has many duplicates. Is there any way to get rid of the duplicates?

    Now on to the search function!!

  6. #6
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Scratch that found it under row source of the combobox and properties.

  7. #7
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Click image for larger version. 

Name:	form.PNG 
Views:	15 
Size:	54.7 KB 
ID:	15482
    Well Im kind of stuck on the search button. Im trying to get it to search "Description". I could be way off but this is what Ive tried:

    Private Sub wpssearch_AfterUpdate()
    Dim strWhere As String




    If Not IsNull(Me.wpssearch) Then
    strWhere = strWhere & "(Forms!wpsinventory![wps subform].Form!Description Like ""*" & Me.wpssearch & "*"") AND "


    End If


    End Sub

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    That is option 2.

    That approach sets the Filter and FilterOn properties of the form. Review the link again and then complete the procedure.

    I always give subform container control a name different from the object it holds, like ctrDetails.

    If you build a search criteria based on only one field, could be simply:

    Me.ctrDetails.Form.Filter = "Description Like ""*" & Me.wpssearch & "*"""
    Me.ctrDetails.Form.FilterOn = True
    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.

  9. #9
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    great that works. So what if I wanted to take this one step further? Currently If i search for a multi word phrase it searches for that exact phrase. For example If I was trying to find this listing
    "KINETIC RACE PANT YELLOW/BLACK SZ 18"
    It wouldnt be found if I searched "Kinetic Pant"

  10. #10
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    http://www.access-programmers.co.uk/...d.php?t=163512

    I found this link that might work for me but Im not sure how I would implement it into my current code.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Would have to break up the string "Kinetic Pant" and build multi-value criteria. The result would be:

    "Description LIKE ""*Kinetic*"" OR Description LIKE ""*Pant*"""
    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.

  12. #12
    82280zx's Avatar
    82280zx is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    82
    revvedmoto

    You can try doing what I just did and see if thats what your looking for. Select WPS Subform Form and go the the property sheet, select the Data Tab, in Filter put [nameofdescriptioncolumn] Like '**'
    then select your wpsearch text box and go to it's property sheet, go to on change and put this in

    Private Sub wpssearch_OnChange()

    WPS Subform.Form.Filter = "[nameofdescriptioncolumn] like '*" & wpssearch.Text & "*'"
    WPS Subform.Form.FilterOn = True

    End Sub

    Thats if your subform is named WPS Subform I'm going off the data from your screenshot above.

    Thanks again June7 btw!
    Last edited by 82280zx; 02-19-2014 at 09:19 PM. Reason: This was meant to be for Revvedmoto

  13. #13
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Honestly I Pretty much have the same thing already but I appreciate the help.
    what I would like it to do is filter for the first word then filter those results with another word

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    I've never tried to program sequential filtering.

    Did you understand post 11?
    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.

  15. #15
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Actually I didnt see #11 must of skipped right over it. This is what I tried with no luck.

    Private Sub wpssearch_AfterUpdate()
    Me.[wps subform].Form.Filter = "Description Like ""*" & Me.wpssearch.Text & "*""" Or "Description Like ""*" & Me.wpssearch.Text & "*"""
    Me.[wps subform].Form.FilterOn = True
    End Sub

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Return the result of a search
    By Loc in forum Programming
    Replies: 11
    Last Post: 06-12-2013, 06:23 PM
  2. Highlight key search result
    By uronmapu in forum Access
    Replies: 28
    Last Post: 06-17-2012, 09:32 AM
  3. Replies: 1
    Last Post: 06-09-2012, 05:44 PM
  4. Replies: 1
    Last Post: 12-20-2011, 03:32 PM
  5. Replies: 3
    Last Post: 06-04-2011, 12:23 PM

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