Results 1 to 4 of 4
  1. #1
    iamtrangdoan is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2019
    Posts
    2

    Search ALL records in a form

    Hi everyone,



    I've been looking all over the internet to get my form displayed all records when a selection is made from a Combo Box, however, I haven't found the solution.

    Below is the table "tblCap_NDT" which I used to create form "frmCap_NDT":

    Company Name NDT
    A Radiographic
    B FPI
    B Radiographic
    D Ultrasonic
    D Radiographic
    D FPI
    D MPI
    E MPI
    E FPI
    E Radiographic
    F Radiographic

    I created a Combo Box in the form header from the "NDT" column and set it to display only unique values. Then I dropped the "Company Name" field to the Detail section of the form. However, the combo box didn't seem to be able to search for all records, rather it couldn't search for anything at all.

    My aim is search for all Company Names when a NDT value from the Combo Box is selected.

    For example, if FPI was selected, the result would count and return B, D, and E (Like 1.B 2.D 3.E)

    I tried to create a subform in the Detail section as well but that didn't work. It seemed to return the first value correctly, however, the rest of the results were all the same as the first. For example, when I selected Ultrasonic, instead of getting only D, I got 4 Ds which I assumed to be all the D left in the table (and certainly they didn't match with the search key "Ultrasonic").

    Can anyone shed me some light on this please? This is driving me crazy since I have no experience in programming or Access. Thank you very much in advance!

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    the query would see the user picked FPI, use it in your query. turn on Grouping/counting,
    qsCount1NDT:
    select NTD , CoName, count(CoName) from table where [NDT] = forms!myForm!cboNdt

    user click a button to open the query:
    Code:
    sub btnOpen_click()
      docmd.openquery "qsCount1NDT"
    end sub

  3. #3
    iamtrangdoan is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2019
    Posts
    2
    Hi @ranman256 , I'm pretty new to Access. Can you please explain where I can turn on that Grouping/Counting thing? I created a new query based on the tblCap_NDT using Query Wizard but I couldn't find that option to Group/Count.

    Thanks a lot for your response!

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    Quite a lot could be wrong in your approach. Best results for you would be to upload your DB here for analysis.

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

Similar Threads

  1. Replies: 12
    Last Post: 01-08-2018, 10:06 AM
  2. Replies: 5
    Last Post: 10-02-2017, 05:19 PM
  3. Replies: 1
    Last Post: 08-13-2017, 11:39 AM
  4. Replies: 11
    Last Post: 10-28-2014, 01:24 PM
  5. Replies: 1
    Last Post: 09-04-2013, 03:24 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