Auto-Fill data entry form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wisni1rr
    New Member
    • Nov 2011
    • 78

    Auto-Fill data entry form

    I have a form "Add" that I use to enter data into my database. All the controls on this form are textbox controls (for data entry). How would I make these textboxes auto-fill as the user types into that text box?

    For example:

    From an empty database.

    I enter "Steven" as a first name into a field bound to my textbox control.

    On the next record, as I type "St" as a first name into my textbox. The textbox should populate with "Steven". Until I finish entering "Stu".

    Basically, I want it to try to populate to the most common entry in each field that the textboxes are bound to based on previous records.

    Any help or insight would be most appriciated.

    Thank!
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    This kind of functionality could be difficult to implement in Access with a text box, as are many other things that we see on webpages.

    My question is what you'd want to see happen if there is more than one match for "St". For instance, what if Steven and Stacy are already in the table? Which one shows up? In the context of a webpage, this issue would be solved by using a drop-down that appears with the possible matches. Taking a cue from that technique, it may be possible to accomplish what you are looking for by using a combo box. If the combo box is bound to the column in question, you can set it to auto fill. I recommend taking a look at that option.

    Pat

    Comment

    • wisni1rr
      New Member
      • Nov 2011
      • 78

      #3
      Pat,

      Thank you for reading my post.

      My thought is that if there are multiple entries that may satisfy the auto-fill, the most commonly used entry will pull up first.

      I understand the auto-fill with a dropdown list. However, would using a combo box still allow for new entries or would it be limited to a specific list?

      Comment

      • patjones
        Recognized Expert Contributor
        • Jun 2007
        • 931

        #4
        Yes, absolutely. There are a few things you need to be aware of in order to make it work. Namely, in the combo box's property sheet:
        1. Column Count should be set to 1.
        2. The Control Source needs to be set to the column that you are doing data entry for.
        3. The Row Source needs to be set to the table in question.
        4. Limit to List needs to be set to 'No'.
        5. Auto Expand is set to 'Yes'.

        When you do this, be aware of what the required columns are. For example, if employee ID, first name, and last name are all required per the table's design, then at minimum you need to supply controls for entering these.

        Comment

        • wisni1rr
          New Member
          • Nov 2011
          • 78

          #5
          It seems to be working for the most part. A few issues:

          The Combo box control is pulling up repeats. (data is alread in the database).

          For example in my CmbCity combo box for city it pulls:
          Code:
          City A
          City A
          City B
          City B
          City B
          I only want each city to show up once in the selection.

          Originally I had this set up with several lookups. This cause a great deal of extra relationships. The structure was not managable.

          *FIXED* I fixed the repetitive entries by adding this as my Row Source:

          Code:
          SELECT distinct [field] FROM [Table] ORDER BY [field]
          However, I cannot select an entry to place in the combo box. It is just a dead click. Hmmm.

          *Fixed* The ControlSource was incorrect.

          Comment

          • wisni1rr
            New Member
            • Nov 2011
            • 78

            #6
            Thanks for your help, Pat!

            Comment

            • patjones
              Recognized Expert Contributor
              • Jun 2007
              • 931

              #7
              It's really no problem. Please feel free to post again if you have other questions in regard to your project! (Make it a new thread if it's about something unrelated to this issue).

              Comment

              Working...