Results 1 to 9 of 9
  1. #1
    dmd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    15

    After Update Macro on Form

    On my form is a combo box where I search for people by their last name. When I update the form with a new record, I have to close the form out in order for that new record to show up when I type it in. I want it to just show up without having to close and re-open the form. Can anyone help? Screen shots attached
    Attached Files Attached Files

  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,772
    Have to requery the combobox.

    VBA:

    Me.comboboxName.Requery
    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
    dmd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    15
    Thanks but where do I put that? I have code in another field called Department and when I click on the field I search on (Go to Employee), and enter code there, it overwrites the code I have for the Department field even though I change it at the top from Combo59 to Combo35 (which is the Go to Employee combo box). Screen shots are attached to show what I'm trying to explain.
    Attached Files Attached Files

  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,772
    Try that code in the combobox GotFocus event procedure.

    It really helps analyzing code if you give controls meaningful names, like cbxDept, cbxEmp.

    Why are there comboboxes for both Department and Dept #?

    Advise not to use spaces and special characters/punctuation (underscore is exception) in naming convention.
    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
    dmd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    15
    There are comboboxes for Department and Dept # because the person who will use it wants to be able to just type in a few letters of the department name, have it populate, then populate the Dept # (which is working).

    But I just can't seem to get this to work. I am trying to learn more every day but sometimes........

    I'm attaching the DB so you can see
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Not seeing code I suggested. Did you try?
    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.

  7. #7
    dmd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    15
    yes, i had tried but it was messing up the other fields that have code in for their purposes so i took it out and sent you the db so you could better understand where i have code and how it's working.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    What do you mean by 'messing up' - errors message, wrong results, nothing happens? I followed my own suggestion and not getting any issues. However, I forgot that need to commit the new record to table for it show in the combobox list. So try the form OnCurrent event instead.

    Private Sub Form_Current()
    Me.Combo35.Requery
    End Sub
    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.

  9. #9
    dmd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    15
    That worked, thank you!

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

Similar Threads

  1. Replies: 6
    Last Post: 11-05-2014, 05:27 PM
  2. Update Table after Record Update with Form
    By speciman_A in forum Forms
    Replies: 25
    Last Post: 10-31-2014, 01:00 PM
  3. Entry Update Form Problem with the update
    By cuddles in forum Forms
    Replies: 1
    Last Post: 05-30-2014, 02:38 PM
  4. Maco
    By jiawen in forum Access
    Replies: 1
    Last Post: 01-15-2013, 03:01 AM
  5. Replies: 7
    Last Post: 09-21-2012, 11:09 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