Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101

    Problem with Search Button

    Hello,

    Am very inexperienced person in the field of ms access. I would like to have some help from one of you.

    I have created a basic form with fields Name, Title, Location and Date. I have created a search button which returns the values that satisfies the search criteria.



    For Ex : If I search for M in the name field then it should return all the names which contains the letter M. It worked well and am quiet happy with it.

    1)The problem is that, the search results are opened in a new tab. If I again search for a letter A in the name field then it's not displaying the results until i closed the tab of 1st searched results. I would like to have the multiple search results in a multiple tabs.

    My Search button is allowing me to only display the results one at a time only.

    2) As the search results are displaying in the new tab, I would like to have the search results at the bootom of my current page instead of new tab.

    Am awaiting for your answers.

    Thanks!!

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Can you share your VBA code? You've explained the issue well, but the code will help provide a quicker answer. Thanks.

  3. #3
    Join Date
    Jul 2011
    Posts
    17
    Quote Originally Posted by Mahendra1000 View Post
    Hello,

    Am very inexperienced person in the field of ms access.
    Quick! Learn Ruby on Rails, or Spring or Django before it's too late (not really kidding, but...)

    Quote Originally Posted by Mahendra1000 View Post
    I would like to have the multiple search results in a multiple tabs.
    Quote Originally Posted by Mahendra1000 View Post
    I would like to have the search results at the bootom of my current page instead of new tab.
    So, which do you want? tabs or no tabs?

  4. #4
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Quote Originally Posted by TG_W View Post
    Can you share your VBA code? You've explained the issue well, but the code will help provide a quicker answer. Thanks.
    I haven't used VBA code. I just used the below query

    Like "*" & [forms]![formname]![columnname] & "*"

    I have created the search button and the above query from the following video

    http://www.599cd.com/VideoPlayer/?FN...mv&W=645&H=430

    Could you kindly have a look into this video and let me know how to proceed with my queries?
    Last edited by Mahendra1000; 09-16-2013 at 03:40 AM.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,621
    You have to refresh the query. Either click the Refresh button on ribbon or run code.

    Why open a query instead of a form or report bound to the query? Users should not interact with tables and queries.
    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.

  6. #6
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Quote Originally Posted by June7 View Post
    You have to refresh the query. Either click the Refresh button on ribbon or run code.

    Why open a query instead of a form or report bound to the query? Users should not interact with tables and queries.
    Sorry. I didn't get you.

    Could you kindly elaborate it please.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,621
    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.

  8. #8
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101

    Hello June7,

    Thanks for those videos. I followed the same procedure from the 3rd video but still am getting only one search results. If I closed the tab of previous search results then only it's returning the new searched results.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,621
    If you want to apply different criteria to already open query, form, report, then must Requery/Refresh. Have you tried setting focus on the open query and clicking the RefreshAll button on ribbon?

    Again, why open a query instead of form or report? Programmatically re-filtering form or report is easier than a query. And users should not work with tables and queries.
    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.

  10. #10
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Try this database example. I based this on the two videos you indicated that you followed and added some light VBA.
    Attached Files Attached Files

  11. #11
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Quote Originally Posted by TG_W View Post
    Try this database example. I based this on the two videos you indicated that you followed and added some light VBA.
    Thanks TG_W

    The file which you attached is the one I was looking for.

    Thanks for doing it to me.

    It was awesome!!

    I got my search button working it now. [I haven't added refresh in the macro which resulted in showing only one result at a time. Am Novice to Access]
    Attached Files Attached Files
    Last edited by Mahendra1000; 09-19-2013 at 06:13 AM.

  12. #12
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    The results returned by the search query having write permissions too. I don't want the front end users to modify the data returned by the search button.

    Could you kindly let me know how to grant only read access permissions to the results returned by search button?
    Last edited by Mahendra1000; 09-19-2013 at 06:16 AM.

  13. #13
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    To restrict from additions/deletions/edits, go to your Results form and change the parameter to "No" for each under the 'Data' tab in the 'Property Sheet'.

    VBA is really the way to go in Access. Macros might not be bad when you are first learning, but VBA is quicker and cleaner to use. I cannot count the times when I wanted to do something in VBA and found it almost immediately just from searching this forum, especially when I first got started.

  14. #14
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Got it

    Thanks for your reply.......

  15. #15
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Make sure to click in the open space so nothing is selected. They are general settings to the form.

    Click image for larger version. 

Name:	Allow SS.PNG 
Views:	21 
Size:	3.5 KB 
ID:	13798

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 08-08-2012, 03:28 PM
  2. Replies: 5
    Last Post: 07-13-2012, 01:15 AM
  3. Replies: 12
    Last Post: 03-22-2012, 02:48 AM
  4. Search Button
    By bomber72 in forum Forms
    Replies: 6
    Last Post: 08-03-2011, 11:44 AM
  5. Search Button
    By injanib in forum Forms
    Replies: 1
    Last Post: 01-16-2011, 07:36 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