Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

combo box not refreshing in VB

  • 02-02-2004 11:16AM
    #1
    Closed Accounts Posts: 1,152 ✭✭✭


    hi all,
    im having this problem with a combobox in my VB app in that it wont refresh when i delete a record from the database. For example, the combo box holds a list of Identification numbers. when i delete a whole record in the db the deleted id number still appears in the combo box. any ideas how i can refresh the combobox after the deletion code?

    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 3,312 ✭✭✭mr_angry


    Right after the deletion code, try the following:

    myCombo.requery()

    That should probably sort it.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by mr_angry
    myCombo.requery()
    Or in VB you might try Combo1.Refresh instead...


  • Registered Users, Registered Users 2 Posts: 2,934 ✭✭✭egan007


    just call the piece of code that populates your combobox after deletion


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by egan007
    just call the piece of code that populates your combobox after deletion
    You're assuming he's not using the VB data control.


  • Registered Users, Registered Users 2 Posts: 2,934 ✭✭✭egan007


    i assume no one uses that - it's the most unflexable ever!!


  • Advertisement
  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by egan007
    i assume no one uses that - it's the most unflexable ever!!
    True, but newbies often use it until they know better.


  • Registered Users, Registered Users 2 Posts: 3,312 ✭✭✭mr_angry


    Originally posted by The Corinthian
    Or in VB you might try Combo1.Refresh instead...

    Dammit - too much VBA in my head. I've almost forgotten all the benefits of VB6!


  • Closed Accounts Posts: 1,152 ✭✭✭sound_wave


    thanks lads.


Advertisement