How can I make intellisense appear as user types in a textbox in ms access 2007?

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

    How can I make intellisense appear as user types in a textbox in ms access 2007?

    Is it possible for a textbox to predict phrase as user types in?I know comboboxes can make it happen but what if I want a text box to do the same and predict string?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    It's probably possible, but would involve quite a bit of coding and handling of characters at a low, and detailed, level.

    Comment

    • HiGu
      New Member
      • Feb 2012
      • 99

      #3
      Okay.If it is possible then how?I searched a lot but could not find any relevant idea.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        It would involve building a database to handle the possibilities and managing keystrokes manually. This is so large a project that it is not an appropriate question for these forums. Having said that, it may not be clear how large a project it is without understanding what it involves, so I understand why you might ask it.

        Essentially, this is much, much bigger/more complicated than you might have thought, and if you're asking for help at that level then I very much doubt you could handle it.

        If you disagree, then the first step would be to do the consideration for the project of exactly what you would need in such a project. If you were to do a proper job of that then I suspect you'd start to understand why I say what I do.

        Comment

        • rekedtechie
          New Member
          • Feb 2012
          • 51

          #5
          Code:
          'declare global variable
          Dim lastSrchs[] As String
          Dim i As Integer = 0
          
          'button click code
          lastSrchs[i] = textboxSearch.text
          i = i + 1
          
          'textbox change code
          Dim isTriggerX As Boolean
          Dim chrToCompare As String
          Dim chrOflastSrch As String
          chrToCompare = Trim(txtboxSearch.text)
          isTriggerX = 0
          For x = 0 To i
          chrOflastSrch = Trim(lastSrchs[x])
          if chrOflastSrch = chrToCompare Then
          listboxRelated.add lastSrchs[x]
          listboxRelated.Visible = 1
          isTriggerX = 1
          End if
          If isTriggerX = 0 Then
          'clear list.
          End If
          Next x
          Last edited by NeoPa; Mar 17 '12, 05:21 PM. Reason: i = 0 cannot be included in button click code because we cannot add another data to String array.. it could be added in the dimensional statement at global the variable declarations.. Mod - Added mand

          Comment

          • rekedtechie
            New Member
            • Feb 2012
            • 51

            #6
            im not sure about this codes.. but i think array can be used as data storage.. if the system is closed the array will reset.
            or else..
            you are willing to save the array values in your database.. which is not good at all.. because theres a high posibility that you save nonsense data in your database. making your database crowded. =)

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32633

              #7
              Please review Before Posting (VBA or SQL) Code.

              @rekedtechie
              I have to disagree strongly with your analysis. Anything other than a table to store the information would be wholly inappropriate and would fail to manage and reflect previous usage. Managing the entries used only in the current session would be pointless, as the data across that session wouldn't even start to be worth the effort.

              I can't say too much about the code except that we like compiled code here for good reason. Such code that is uncompiled and uncompilable tends only to mislead users. Even looking at it as pseudo-code I fail to see how it can be considered even as illustrating the fundamental logic required for this question. The obvious omission of any event procedures indicates clearly it cannot correctly handle the problem raised.

              I'm not here to have a go at your code. I just felt it was important not to allow the idea that it is a viable solution to go unchallenged, as it misleads those less experienced and less capable members into following a dead-end path.

              Comment

              • rekedtechie
                New Member
                • Feb 2012
                • 51

                #8
                @mod[NeoPa]

                im sorry but i dont have PC at home..
                i do all my school project at computershop, and that makes me 'ughh..' for the rest of my college life..
                i need to bypass all security just to make my assignments..
                thats the reason why its so hard being a poor..haha :))

                -but thanks to your post now i know that i dont need to create a project that will save temp data..im trying to relate with vba.. because i saw macros before and its totaly looks like vb6.. =)

                Comment

                • TheSmileyCoder
                  Recognized Expert Moderator Top Contributor
                  • Dec 2009
                  • 2322

                  #9
                  I would like to know why you are so adamantly against using a combobox?

                  You can make a combobox act more like a textbox if that is what you require, and its far easier then making a textbox act like a combobox.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32633

                    #10
                    Who's adamantly against use of the ComboBox Smiley?

                    Comment

                    • TheSmileyCoder
                      Recognized Expert Moderator Top Contributor
                      • Dec 2009
                      • 2322

                      #11
                      Originally posted by NeoPa
                      Who's adamantly against use of the ComboBox Smiley?
                      As I re-read the first post I see that the word "adamantly" is an exageration. I was merely wondering why HiGu would like to NOT use the combobox.

                      Comment

                      • HiGu
                        New Member
                        • Feb 2012
                        • 99

                        #12
                        Hey.I am not against using a combobox.I know that would be easier in this case.I am a fresher in an IT company and a search textbox is what my clients have requested for.Now I see I will give them a combobox only with the features they want.Thank you all for a good discussion over this.I actually thought vba must have some built-in functions for this.

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32633

                          #13
                          @HiGu
                          I still believe it's unwise even to consider such an endeavour at your level of understanding. Ultimately it's your call of course.

                          Comment

                          Working...