Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    31

    Question Unanswered: Problem with list

    I made combo box with value list based on another combo box
    the first combo for "states" and the other combo box for "Cities" so if u choose a state the other combo will reveal a list of cities i this state,
    I have one problem is that if I select for e.g Nebraska and Omaha rom the [citycbo], then I go back to change the state in the same record e.g to Missoury the [citycbo] although the list is updated yet it retains the previous value which is Omaha
    I want to correct this so if i Change the state it automatically refresh the [citycbo]and remove the previous value and set focus to it
    Thanks in advance for your help

  2. #2
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    Maybe,

    private sub citycbo_afterupdate()
    call yourVBAcode 'To fill the listbox
    end sub

  3. #3
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Problem with list

    The VBA code that you need is

    private sub statecbo_afterupdate()
    citycbo.Requery
    citycbo.value = ""
    End Sub

    of if you want it to display the first city after the state is selected replace
    citycbo.value = ""
    with
    citycbo.value = citycbo.column(0,0)

    Hope this helps ...

    Originally posted by mselima
    I made combo box with value list based on another combo box
    the first combo for "states" and the other combo box for "Cities" so if u choose a state the other combo will reveal a list of cities i this state,
    I have one problem is that if I select for e.g Nebraska and Omaha rom the [citycbo], then I go back to change the state in the same record e.g to Missoury the [citycbo] although the list is updated yet it retains the previous value which is Omaha
    I want to correct this so if i Change the state it automatically refresh the [citycbo]and remove the previous value and set focus to it
    Thanks in advance for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •