Results 1 to 5 of 5
  1. #1
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30

    Need help on how to update a list box immediately after entering data in a text box!!!

    I hope somebody can help on this.



    Simply, I have a List box (lboTitles) in a form; its list items are pulled from a table via a query, and a bound text box (txtTitle). When a user enters text in the txtTitle text box, I want my Afterupdate event procedure txtTitle_Afterupdate to immediately update the list box (lboTitles) showing the newly entered title in the txtTitle. Currently all I have in the txtTitles_Afterupdate() is : me.lboTitles.Requery. Guess what! it is not working. I have tried and tried but no luck. Experts please help. Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    The textbox is bound to the table the listbox uses? You probably need to save the record first:

    If Me.Dirty Then Me.Dirty = False
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    NKB is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    30
    More clarifications: If a user selects an item in the list box lboTitles and he enters a text in txtTitle, then I want the code to immediately update the selected list box item to reflect the new change. I am not adding an item but changing the text of a selected item. That's all I want to do. How to do it? I do not know

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,706
    try:
    Code:
    txtTitles_Afterupdate()
    me.requery   
    me.lboTitles.Requery

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Is the form bound to the same table? You can use the listbox or combo wizard to make the form go to the selected record, and let the user change the value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Entering Data to update all tables.
    By mike02 in forum Forms
    Replies: 19
    Last Post: 06-06-2013, 09:06 AM
  2. List Box selection not entering data in table
    By MFS in forum Programming
    Replies: 6
    Last Post: 03-19-2013, 11:03 AM
  3. Updating drop down list after entering data
    By robertfp in forum Database Design
    Replies: 2
    Last Post: 09-17-2012, 02:46 PM
  4. Immediately update table with form?
    By Rosier75 in forum Forms
    Replies: 6
    Last Post: 06-08-2012, 09:11 AM
  5. Replies: 2
    Last Post: 02-13-2010, 01:54 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