Results 1 to 5 of 5
  1. #1
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114

    After Update ReQuery and update text box

    I need to enter a number from a combo box and then have two additional fields update themselves automatically using a query. I'm sure I should be using the After Update event but I can't find anything that shows me the correct code.

    The query must be used because I'm also going to use it for other tasks. I could do a (Allen Browne) search form set up, but that seems more complex than I actually need. Is there a simple way to hook the fields up to the query and then update the query once I enter information

    Example DB is attached.

    Example - After Update Event.zip?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Can't reference table or query directly like that in textbox. Would require a DLookup(). However, preferred method is just to reference combobox column index. Index begins with 0.

    =[Combo0].[Column](1)

    =[Combo0].[Column](2)

    This is not updating any fields, just populating unbound textboxes.
    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.

  3. #3
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    I thought you were going to say that. I use it on other forms but can't for this example. The problem is I have to use the other 2 fields in the query separate operations which is why I was hoping for an After Update event. If I use the combo box method those fields can't be used for anything other than information.

    As always, I appreciate your time and thanks for answering my question. I think I'll just use the search form method.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Can certainly have code in AfterUpdate event that sets value of textboxes. Just not understanding why can't use method I suggested.
    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.

  5. #5
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    NVM - You are correct. I messed up some of the settings when I was doing the combo box. Your method works perfectly. I originally thought the information was for informational purposes only and I didn't realize you could use it as criteria in a query. Thanks. Problem solved.

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

Similar Threads

  1. Requery Does Not Update Listbox Row Source
    By szucker1 in forum Forms
    Replies: 7
    Last Post: 02-11-2014, 08:58 AM
  2. Requery does not update combo box
    By pbouk in forum Forms
    Replies: 1
    Last Post: 03-25-2013, 03:01 PM
  3. Replies: 19
    Last Post: 11-01-2012, 08:03 AM
  4. Requery subform after update of main form
    By gemadan96 in forum Forms
    Replies: 3
    Last Post: 10-17-2012, 02:33 PM
  5. after DAO update, listbox.requery not refreshing
    By EuniceH in forum Programming
    Replies: 2
    Last Post: 10-21-2011, 04:16 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