Results 1 to 5 of 5
  1. #1
    jeanpri is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    15

    How to refresh a row source in a combo box from a query ?

    Hello,

    This is my combo box "Customer application" with the Row Source Type = Table/Query and Row Source = ApplicationQuery (a query which contains some predefined applications)

    Click image for larger version. 

Name:	combobox.JPG 
Views:	23 
Size:	25.4 KB 
ID:	7466

    In the combo box "Customer application" I want to select the text proposed by the list (as you can see on the picture) or enter a new application (this is working).

    The problem is when I enter a new application on the field, and I jump to another combo box "Customer application" this new application doesn't appear on the list, while the new application is right added to the query ApplicationQuery.

    When I close and re-open the form the new application appear in the list. How can I do to make that a new entered application in the combo box appear instantly in the list without close and re-open the form ?

    Thanks a lot !

    Jean

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  3. #3
    jeanpri is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    15
    Thanks for the reply !

    Interesting but it's not working: in VBA the function CustomerApplication.Requery is called each time there is a change (AfterUpdate).

    (CustomerApplication is the name of my combo box and need to be refreshed each time there is a new entry).

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Can you post your mdb? Remove any confidential data.

  5. #5
    jeanpri is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    15
    Thanks for your help, I find the solution ! .Requery function works better at combo box exit.

    So if you want to refresh the list in the combo box called CustomerApplication add this code in VBA:


    Private Sub CustomerApplication_Exit(Cancel As Integer)
    CustomerApplication.Requery
    End Sub




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

Similar Threads

  1. Access 2010 Refresh VS Refresh ALL
    By Snwboarder1982 in forum Access
    Replies: 1
    Last Post: 09-09-2011, 04:07 PM
  2. Replies: 7
    Last Post: 06-30-2011, 12:20 PM
  3. Access Combo Box Refresh
    By gafoor in forum Forms
    Replies: 1
    Last Post: 03-04-2011, 04:00 AM
  4. Combo refresh
    By gafoor in forum Forms
    Replies: 0
    Last Post: 03-02-2011, 04:24 AM
  5. Replies: 1
    Last Post: 03-01-2011, 03:04 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