Results 1 to 14 of 14
  1. #1
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7

    Question Creating A Form Search


    I need to create a simple search on a form with a list. Basically, all I need it to do is search the list for any given string, a user enters a string into a sear box and it queries the form. Currently, I am using a split form with a split database. I am not sure if I need to use a macro or setup up a quick filter to do this, Any I am happy to post more info if you need. Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    but what field?
    is this string going to search in 1 field in 1 table?
    or all fields or all tables?

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    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.

  4. #4
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7
    It should be able to search all fields within the datasheet associated with the form.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    Did you review the referenced link?
    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.

  6. #6
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7
    I am using the attached template. Basically, I have imported my data into the form and added some additional fields. In the "Asset" table. The data shows correctly in the "Asset List" Form but I cant use the search. When I try to use it returns nothing. from what I gather its using a filter based off some embedded Macros?
    Attached Files Attached Files

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    This is a MS template. Yes, many of them do use macros. It also uses lookups in table which I never do. You probably need to change the ValueList items. Or build some lookup tables and modify the comboboxes on form then remove lookups from table.

    There are no records in the uploaded db. You provided the accdt template, not your modified accdb.
    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.

  8. #8
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7
    well, that's just it. if I use that template as is, and enter a new field in the asset list table and to the asset list form. I cant search it the only thing that seems to be searchable is the "item" field.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    When you open the accdt it should prompt you to save as an accdb and you work with the accdb as your db. Is that what you did? Then you modified the accdb? That is the db you need to provide for analysis.
    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.

  10. #10
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7
    I have attached it. You will notice if you add a new field it will not be searchable in the search field.

    https://imgur.com/a/iILDKom
    Attached Files Attached Files

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    Yes, AssetList form only searches Item field. You already added field(s) to this db? Which one(s). Did this work differently before adding field(s)?

    However, the search on ContactList does work for all fields.

    Personally, I would convert all macros to VBA. I don't use macros and find debugging them frustrating.

    Review https://sourcedaddy.com/ms-access/te...ing-macro.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.

  12. #12
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7
    yes I added the "Asset Tag" field. Where is the search is defined in the assetlist form?

  13. #13
    requiemzz is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    7
    Look like you can convert a macro to VB right from within access. I found this snippet of code that seems useful:
    Code:
    End If
            ' Apply Filters
            TempVars.Add "FilterString", DLookup("[Filter String]", "Filters", "ID = " & Screen.ActiveControl)
            TempVars.Add "SortString", DLookup("[Sort String]", "Filters", "ID = " & Screen.ActiveControl)
            If (Not IsNull(TempVars!FilterString)) Then

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    There are embedded macros associated with button cmdSearchGo.

    I have never used TempVars nor Screen.ActiveControl. Suggest you review the Allen Browne link in post 3.

    Only 1 time have I ever set up db to store user defined filter criteria into table for retrieval and reuse. Don't think it actually got used much.
    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.

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

Similar Threads

  1. Creating a Search form.
    By TrulyVisceral in forum Forms
    Replies: 6
    Last Post: 04-17-2018, 05:51 AM
  2. Replies: 1
    Last Post: 11-30-2016, 03:41 AM
  3. Replies: 8
    Last Post: 09-02-2015, 03:00 PM
  4. Help creating a search form
    By ttn022191 in forum Sample Databases
    Replies: 5
    Last Post: 09-26-2014, 01:39 PM
  5. creating a search form
    By foxtet in forum Forms
    Replies: 4
    Last Post: 08-06-2011, 06:08 AM

Tags for this Thread

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