Results 1 to 4 of 4
  1. #1
    kft10 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    1

    How to auto populate in tex box form

    Hi All,



    I have created a form that have many fields, some of the fields are repeated from the previous records (have the same contain as the previous records) such as lawyer name, location etc. My question is, can I create a text box (not combo box) to auto populate for those fields that have the same as the previous records?

    So, basically I'd like to create the text box that have the same feature as MS Excel. if we already entered data in the previous row (records) for example 'ABC Community Health Center' in field 'Location', when we type the first 2 or 3 character ('ABC') on the that field, the system will complete the rest of the words (ABC Community Health Center). If someone in the forum can give me an idea, I really appreciate it.

    Thank in advance.

    Regards,
    KFT

  2. #2
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Hi KFT.

    Sure, there's lots of ways to do that. You can, for example, load a dropdown box (a combo box) with the values for a field that have been used before, and the user can select them with the mouse or by typing the first few letters to get an autofill.

    The combo box, for example called cboLocation, would have its RowSource property set to say something like "SELECT Location from MyTable, ORDER BY LOCATION;" You would probably set the LimitToList property to No, so the user could also add new ones.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Alternatively, you could put the following line of code in the After Update event of "Location":
    Code:
        Me.ActiveControl.DefaultValue = Me.ActiveControl
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,961
    Use both ideas. The combobox to select values in first record and the code to set DefaultValue property so data will automatically populate in next record.
    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. Auto Populate form
    By fpsmi in forum Access
    Replies: 1
    Last Post: 09-16-2011, 09:24 AM
  2. Auto populate a field (without a form)
    By DonL in forum Access
    Replies: 1
    Last Post: 06-21-2011, 03:19 AM
  3. Split Form - Auto Populate
    By CCAccess2010 in forum Forms
    Replies: 2
    Last Post: 10-04-2010, 06:33 AM
  4. Auto populate form using combo box
    By bundy75 in forum Access
    Replies: 6
    Last Post: 08-29-2010, 06:18 AM
  5. Auto populate fields on a form
    By ldarley in forum Forms
    Replies: 0
    Last Post: 08-14-2008, 09:39 AM

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