Results 1 to 12 of 12
  1. #1
    NGFLNG1 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    16

    Requery - "Want another search"

    Hello,



    I have designed a query that has a dialogue box that asks, "Enter the Section you require"--or words to that effect. Then the results are shown. But I want another dialogue box to pop up immediately after the first query that will ask, "Do you want to perform another search?". If the user chooses yes, I want the original question to pop up again.

    Does anyone know how that is accomplished? Thank you in advance.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Personally, I find this mechanic clunky. What you may want to try is this:

    If you have a form in your database, put a combo box on that form that selects the 'section', then in the query design instead of having a prompt in the criteira for [Enter the Section you Require] you would have a reference to the field on the form like:

    [forms]![formname]![fieldname]

    So let's say your form name is frmSearch and the field on that form is cboSection (combo box with all the section numbers) your criteria in your query would be

    [forms]![frmSearch]![cboSection]

    Then when they close the query they can choose another section and not have to rely on typing it in correctly, they will be picking from a pre-defined list.

  3. #3
    NGFLNG1 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    16
    I don't have a form made for that purpose. I guess I should have told you I just want to pull the names of the people in a particular Section.

    So I created a "blank" form with a combo box, but that was the only thing I put on it. How do I get the names to show up, along with the section (so I can be sure they are in the Section ordered up)?

    Should I start from a "blank" form, use the wizard, or some other option?

    Thx again!

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  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,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.

  6. #6
    NGFLNG1 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    16

    Requery- Update

    Okay, my search form now works using Mr. Allen's basic form. I changed some of the search criteria in the "event procedure" behind the "Filter" button and it worked beautifully.


    However, I added a label to show all of the names you can search on when searching for the particular "Section". Two of them are named: S&S, P&C. Notice the commonality of the ampersand. The problem is the form just shows SS or P&C (C is underlined). However the user must search for "S&S" vice SS or there will be no results. I entered the data for the label in the "Caption" property of the label.

    Is there a way around this issue?

    Thx again!

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    the & on a control will give you the means to 'click' that button with a keystroke (alt plus the letter) so if you have a button where the caption is &Add you can hit alt-a and simulate the button click. Your control to provide the criteria for the search should be a text box, combo box or list box, not a label or control (button) and the ampersand should show up just fine in text boxes etc.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Double the & to force it to be normal text in label or button caption.

    However, as rpeare says, controls for inputting filter criteria should be UNBOUND data controls, not labels. How are you using a label to show all the names? And how is label used to construct filter criteria string?
    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.

  9. #9
    NGFLNG1 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    16
    My label is just off to the side. I still have the unbound control that Mr. Allen used in his sample DB for the search criteria.

    So I took June7's advice and doubled the ampersand and now the label displays correctly. So thank you both.

    I need to mark this thread "SOLVED".

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Thread Tools dropdown above first post.
    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.

  11. #11
    NGFLNG1 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2014
    Posts
    16
    Thread tools only give the option to mark as unsolved. I do not see an option to mark as "solved". Threre are a couple of other options, but not related.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That's because I already marked thread as solved.
    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.

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

Similar Threads

  1. Replies: 7
    Last Post: 12-21-2014, 08:21 PM
  2. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  3. Replies: 5
    Last Post: 12-14-2013, 06:29 AM
  4. Replies: 11
    Last Post: 06-18-2013, 07:48 AM
  5. Replies: 8
    Last Post: 03-05-2013, 01:20 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