Results 1 to 7 of 7
  1. #1
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56

    Query results inside a form


    I have a query built. I dragged it onto my form. At the top of the form I have a text box. I want to be able to enter data into that text box and when I hit enter or tab it runs the query I dragged on the form using the data entered into the text box.

    How can this be achieved?

    Thanks,
    Tom

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    One method is with parameterized query as the form RecordSource. Review: http://www.datapigtechnologies.com/f...tomfilter.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
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    When you drag a query onto a form; it creates a sub form in datasheet view. So that's really where you are - if I interpret your post correctly. The content of the sub form depends on the master/child link to the main form.....and then is controlled by the record that the main form is on.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If this is main/subform arrangement, is the main form bound? If not, could have a solo form in Continuous view, put the filter input text or combo box in the header of the form. The controls in detail section can be arranged to look like datasheet view.
    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
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    This is a Main form bound to a table. I simply need to read the first text box and make that the entry to the query, run the query, and show the query right on the main form. If it's easier to make the query pop-up instead of being on the main form I am not against that either. I just need the users to be able to view the query easily while still interacting with the main form.

  6. #6
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    I made some progress and I think I am close.

    Main form has a control button on it to requery the subform.

    Private Sub AccountSearch_Click()
    Me.LookupTest_subform2.Requery
    End Sub

    Then, the criteria of my Query is pointed to the [Forms]![MainForm]![textbox]

    When I click the button it puts the data entered into the textbox on main form, and enters that information into the subform query but it doesn't appear to actually be running the query, meaning it just sticks the data from textbox in first field of subform(datasheet view) and doesn't perform the query, no other information is displayed.

    I feel I am close, what do you think?

  7. #7
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    Figured it out. Instead of running the query from control button I am simply performing a requery on the subform, which is bound to the mainform first textbox. Working great!

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

Similar Threads

  1. Replies: 1
    Last Post: 02-03-2014, 03:06 PM
  2. Opening Query results Inside a Form
    By Nelson12 in forum Forms
    Replies: 6
    Last Post: 12-24-2013, 01:10 PM
  3. Replies: 10
    Last Post: 09-13-2012, 07:22 PM
  4. Replies: 1
    Last Post: 09-05-2012, 07:04 AM
  5. Replies: 6
    Last Post: 05-14-2012, 07:24 AM

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