Results 1 to 4 of 4
  1. #1
    Danny729 is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2022
    Posts
    4

    Search Table

    I have a form that has 10 different fields to list document numbers.


    These fields are named DocNo1, DocNo2, etc.

    If like to create another form in this database that has a text box and when I type a document number it provides a list of all the IDs of the records where the typed in document number is on one of the 10 fields describe in the first sentence of this post.

    Is this possible, if so, how do I do this?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,933
    Sounds like your data is not normalised?
    If not, you will jump through hoops getting what should be simple.
    I thought allen browne had a function to search through fields in a record, but that might have just been min and max.
    http://allenbrowne.com/tips.html
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,933
    Duplicate post?
    Reply was still in reply field?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Just for the exercise and if I am understanding your description, on the 2nd form with the search DocNo field "SearchDocNo" in form header, add all the other fields to the detail section of form, make the recordsource for that form a query based on the data table, list all the 10 fields and in criteria for each field put something like "= Forms![Form2]![SearchDocNo]" then for 2nd and subsequent fields in the OR row put same "= Forms![Form2]![SearchDocNo]" in the OR box and do that for all 10 fields (each new field you have to put it in the OR row below the previous one) so basically it is saying if whatever you typed into SearchDocNo is in any of the 10 fields, grab that record. You would need to put an event with Forms!Form2!Requery in the AfterUpdate event in that SearchDocNo field to do the action.

    You could also do it in code say on a button to select those records based on the search field value and put that as the recordsource and then repaint or requery Form2.

    Not the best way but maybe a way .

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

Similar Threads

  1. Replies: 51
    Last Post: 07-05-2022, 03:24 PM
  2. Table combobox search and table lookup
    By uresan in forum Access
    Replies: 6
    Last Post: 03-02-2022, 05:57 PM
  3. Search through a table
    By Thompyt in forum Programming
    Replies: 21
    Last Post: 03-20-2017, 06:41 PM
  4. Replies: 25
    Last Post: 03-19-2013, 10:08 PM
  5. Replies: 1
    Last Post: 04-11-2012, 03:30 PM

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