Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

combo box not refreshing in VB

Options
  • 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 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 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 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 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