How to filter a form based on user input when the input can occur in any format?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HiGu
    New Member
    • Feb 2012
    • 99

    #16
    Yes I did both but no data is displayed then.Has it got anything to do with the same properties in the properties pane?Do I need to set
    Code:
    Filter On Load = Yes
    ?

    Comment

    • HiGu
      New Member
      • Feb 2012
      • 99

      #17
      Isn't the above code applicabtle for a combobox?

      Comment

      • HiGu
        New Member
        • Feb 2012
        • 99

        #18
        Can I change the recordsource of the form everytime I want filtering?That should be simple.There is one more problem,the main question to filter based on user input..If I input values in a particular format I get errors saying the text is not valid.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32661

          #19
          Originally posted by HiGu
          HiGu:
          Do I need to set
          Code:
          Filter On Load = Yes
          That wouldn't even be possible.

          Originally posted by HiGu
          HiGu:
          Isn't the above code applicabtle for a combobox?
          ??? No idea what you're trying to ask. 'above code' could refer to so many things.

          Originally posted by HiGu
          HiGu:
          Can I change the recordsource of the form everytime I want filtering?That should be simple.
          It's possible, but not simple. Far more complex than adjusting the filter, and a fundamentally clumsy approach.

          The idea, if you have a problem with something, is to fix that something. If you always look for ways around your problem you will build up an experience library of problems rather than one of solutions and better understanding.

          It seems clear you are unable to identify what is wrong with the solution I've suggested. I strongly suspect that it's due to your failing to follow the instructions correctly (which could be for many reasons), but without reliable information from you I cannot say for sure.

          I'm hesitant to suggest anything as the differences between opening the form again (which you say worked) and refiltering the current form are so minor I have no idea how one could work and the other not if all you report is true. It doesn't make sense.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32661

            #20
            Originally posted by HiGu
            HiGu:
            There is one more problem,the main question to filter based on user input..If I input values in a particular format I get errors saying the text is not valid.
            Guessing games. Oh good. I like them. Now I wonder what format you might be talking about...

            Actually, if you want some help with this it might be a better idea to explain what you're talking about ;-)

            Comment

            • HiGu
              New Member
              • Feb 2012
              • 99

              #21
              1. There is no input mask that I am using.I simply want to allow the user to enter something like E-2y-4999 which means the user should be able to enter '-' also in the combobox or any text.However, if I try to enter any such value and press 'enter' I get a messagebox saying that "the text you entered is not in the list"
              2. I just happened to add this
              Code:
              DoCmd.RunCommand acCmdApplyFilterSort
              to NeoPa's Post#8 and I was prompted to give a paramete to the dialog box.I gave the parameter and guess what!It filtered!This was soothing.Howeve r no one would like to be prompted to add a parameter.But I am happy atleast it worked somehow but only not for all the values in the combobox.The only problem will be filtering when the value is null.
              Last edited by HiGu; Mar 21 '12, 05:04 AM. Reason: Add one more point.

              Comment

              • HiGu
                New Member
                • Feb 2012
                • 99

                #22
                What I tried just now is setting the LimitToList property to NO and now I see the combobox doesn't give any error on user input infact things are working fine but the only problem is that there will not be any intellisense now.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32661

                  #23
                  @HiGu

                  You keep moving the question. These new issues are separate issues and should be dealt with separately. I cannot keep commenting on every choice you make which is nothing to do with what I've suggested. Your choices are largely counter-intuited and I have no idea where they come from.

                  Questions on Bytes are supposed to be single questions and not a running project support. If you haven't got this to work yet then you are welcome to continue with it here, but only if you go back to the question and remove all the other things you've tried that I haven't suggested. If you want to try them again later after this thread is finished with then be my guest, but while I'm spending time with you on this you must not make changes that don't reflect what is discussed in the thread.

                  If you think about it I'm sure it will be obvious to you, too, that that is not a very clever way to proceed.

                  Comment

                  Working...