Results 1 to 6 of 6
  1. #1
    D347HxD is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    6

    Search a query, post on form?

    http://www.mediafire.com/?36bhszdxj6n810t

    Above is my current database I am working on. As you can see, when you open the SearchF form it brigns up a bunch of search options and when you type something in, and click run query it runs it, and searching the SearchQ query for what you typed in. It launches the query, but how would I accomplish that to instead of launching the query it launches a form that has the query on it?

    Better yet, how can I set it up so the query and search functions are on the same form?



    Note: OrderT is the table being used, CustomerT is something I am playing around with.

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Put a subform control on the form, make the query the source of the subform, and refresh the subquery every time any of the search options are changed.

  3. #3
    D347HxD is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    6
    Quote Originally Posted by Dal Jeanis View Post
    Put a subform control on the form, make the query the source of the subform, and refresh the subquery every time any of the search options are changed.
    How would I go about refreshing the subquery every time any of the search options are changed?

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    When you run your code for the execution of the query, add this line
    Code:
    me.requery

  5. #5
    D347HxD is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    6
    sorry, I am really new with Access. I don't quite understand what you mean. The only place I really have any code is on the query it self under criteria and under that I have:
    Code:
    Like "*" & [Forms]![SearchF]![BusinessName] & "*"
    BusinessName being replaced with the other 14 text box names for the other search bars.

    Under the button, I am using events. It uses OpenQuery, and CloseWindow (though since I now have the subquery attached to my form, I since removed the CloseWindow event.)

    Where would I put the bit of code you gave me?

    EDIT: Fooling around with everything I figured out where to put it and it now works! Woo! Though there is one more thing I need, on another topic (it does evolve the subquery + form though).

    http://www.mediafire.com/?36bhszdxj6n810t

    That is my current database. Once again, CustomerT isn't needed, ignore it for now. What I want is on SearchF, the add button. How would I set it up so when I write in the text boxes beside that, and push add it adds it to the OrderT for the query to be able to look up when you search later? It sounds simple, but I have no clue where to start.

  6. #6
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    D3 - when you have a totally new question, please start a new thread. You'll get more/better attention.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-26-2013, 03:07 PM
  2. Need to post a text in Form...
    By Stephanie53 in forum Forms
    Replies: 2
    Last Post: 04-02-2013, 09:08 AM
  3. Replies: 6
    Last Post: 11-15-2012, 05:38 PM
  4. Replies: 2
    Last Post: 06-05-2012, 12:33 PM
  5. Replies: 3
    Last Post: 02-21-2012, 10:59 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