Moving records up or down in a listbox based on Up or Down Button selection in a windows form

Posted on 2005-05-04
Last Modified: 2011-09-20
I need to allow my users to move records up or down in a list box.  I thought I would just add buttons (up and down) and move the items on 'click' of the button.  My problem is I can't come up with code to make this work.

I'll write the record(s) back to the DB table with the corrected order when the user leaves the form.

Thanks in advance..

Question by:TMHPROG
    LVL 25

    Accepted Solution

    LVL 27

    Expert Comment

    the database does not care what order the listbox is in.
    the database replaces or adds to the database according to the database parameters.

    Author Comment


    Thanks... That should work.


    Understood... I just meant I will do updates to the records in the list box with the reassigned order values.

    Again.... thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now