Results 1 to 4 of 4
  1. #1
    rebfein's Avatar
    rebfein is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2015
    Location
    So Cal
    Posts
    114

    How do I create a form to query a query?

    Well it's been 6 1/2 months of design, setup, data entry and questions regarding this project for my boss.



    I want to thank all of you for being so helpful with all of this. Can I ask you to help me one more time...

    I want to create a form, based on a query, that will display a sub-set of information from the query.

    The original table contains records of an ECO, ECODate, Model number, Old modification number, New modification number and a note field. All fields are set to text format, except for the ECODate field (set to date, formatted as Short Date). The modification fields have a lot of zeros, 'VOID' and other entries, so I set the query results to filter contain only numbers over '0.'
    The original query contains records of the Model number, ECO, Old modification number and New modification fields.

    I want to set up the form to connect to the query so that when the user enters the model number and hits the enter key; the data results (either on the form or in a separate table/display) will show all the ECO modifications for that unit.

    Any ideas on how to do this. I'm asking now and searching Google after sending this off.

    Thank you,

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    open a query that looks at the form for the model
    Code:
    sub txtBox_Afterupdate()
      docmd.openquery "qsFindModel"
    end sub

    the sql for qsfindModel would be:
    select * from table where [modelno]=forms!myform!txtBox

    OR
    better would be to just filter.
    in a continuous form of data, enter the Model# ,press enter, this activates the filter
    Code:
    sub txtBox_Afterupdate()
    If IsNull(txtBox) Then
       Me.FilterOn = False
    Else
       Me.Filter = "[ModelNo]='" & me.txtBox & "'"
       Me.FilterOn = False
    End If
    end sub

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    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
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    June's suggestion is the go to reference for a flexible search form.
    You may also find some helpful info in this free youtube video by Steve Bishop
    Good luck

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

Similar Threads

  1. Using a form to create an Append query?
    By Access_Novice in forum Forms
    Replies: 6
    Last Post: 10-04-2013, 11:39 AM
  2. Create a query from a form
    By Triscia in forum Queries
    Replies: 3
    Last Post: 09-12-2013, 11:22 AM
  3. how to create query from form?
    By asinha9 in forum Queries
    Replies: 11
    Last Post: 04-23-2013, 06:04 PM
  4. Replies: 3
    Last Post: 07-10-2012, 05:23 AM
  5. Code to create a query from a form
    By stryder09 in forum Queries
    Replies: 15
    Last Post: 10-17-2011, 01:55 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