Results 1 to 9 of 9
  1. #1
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46

    Filter on Form Control Based on User Inputted Criteria

    Filter, Filter-on-Form, Filter by Selection....I have reviewed probably a hundred or more posts on this subject and still I am struggling with what I need to accomplish. I don't even have good code to share at this point, and yes (slap me now!) I even ventured back into the world of trying to use a Macro to do what I want, and while it did get me part of the way there, I cannot get over the final couple of steps. So here goes and I am going to describe how to do this manually using the toolbar selections to accomplish what is needed. And my apologies if it seems that I am insulting anyone's intelligence. I think I have thought about this so much, and tried so many different things, that I probably have confused myself.

    In Form A the user will select the [Badge] field. Then from the toolbar they select the large Filter button from the Sort & Filter menu. This opens up a small menu (within) the [Badge] field, where the user has options to sort A to Z, Z to A, and so forth. In my case, the user needs to select "Text Filters", and then I want them to choose the first choice, "Equals..." This results in giving them a selection box to enter the Badge number of the record they want to see. The final part of this is the ability to email a copy of the form (record) in .pdf format, and I have the code already for that portion. It is getting through the Filter, Text Filters, Equals... part that I am having a hard time with. Like I said, doing this manually works perfect, but for the multiple end users of this db, simplifying it for them, really will make my life easier.

    Thanks in advance for any assistance provided.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    suggest describe your form or show a screenshot as your description is not that clear. For example

    Then from the toolbar they select the large Filter button from the Sort & Filter menu. This opens up a small menu (within) the [Badge] field, where the user has options to sort A to Z, Z to A, and so forth.
    Normally the user would use a right click to display this menu

    It sounds like you have a textbox where users enter some text and then you want to automatically filter a continuous form. The code should be straightforward

  3. #3
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46
    The text box is not sure a search box, but is an existing field with information in it - employees badge numbers.

    Click image for larger version. 

Name:	Screenshot.jpg 
Views:	12 
Size:	26.0 KB 
ID:	39239

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,740
    You have described the manual process of the search. For the automated approach,
    what action would the user take to start the automated process of the search that you want to code?

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    So the badge control has a controlsource? if so then perhaps on that controls doubleclick event put

    me.filter="Badge='" & me.badge & "'"
    me.filteron=true

  6. #6
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46
    Ajax - thanks for your reply. That filters the record for the current badge number in the field, but I need for it to open up a dialog box, similar to the manual process I described, so that the user can enter the badge number for the record they are wanting to filter.

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    how about just having an unbound 'badge number search' field.

    Then base your form on a query where you have a formula something like

    like "*" & forms!formname![badgenumberfieldname] & "*"

    then you could search for any portion of a badge number.

    Then all you'd have to do is have a button to me.requery

  8. #8
    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
    Perhaps you are working too closely with what you are doing manually. Agree with others that automating may be more efficient interface. But you know you processes better than any reader.

  9. #9
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46
    Thanks. I think that may be the method to use, and the easiest. The form is already being fed from a query, so adding the search field may be the best way to go.

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

Similar Threads

  1. Filter combo box data based on a form control
    By onechriswhite in forum Forms
    Replies: 6
    Last Post: 08-29-2015, 09:21 PM
  2. Replies: 3
    Last Post: 11-14-2014, 02:51 PM
  3. Replies: 12
    Last Post: 06-12-2014, 07:37 AM
  4. Replies: 3
    Last Post: 04-09-2014, 09:43 AM
  5. Replies: 19
    Last Post: 04-23-2013, 05:45 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