I have a project that is due in a few days and I'm having an issue with one section. I created a really simply movie rental program and have a form for customers that uses a local DB for all the information on that form, one item on that table is "rentals" and is displayed as a listbox (to obviously display the movies they are renting). I then have a button to open a new window to select the movie rentals and that window is just a simple checkbox listbox with several items in there.

My issue currently is getting that information over to the rentals listbox but have it only update the record I was currently on.

Here is a snippet of the code that copies the selections to the listbox:

'Movie Selection
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim movCount As Short
        movCount = cbMovieList.Items.Count - 1

        For i = 0 To movCount
            If cbMovieList.GetItemChecked(i) = True Then
                frmCustomerMenu.lbMovieRentals.Items.Add(cbMovieList.Items(i))
            End If
        Next i
        Me.Hide()
        frmCustomerMenu.Show()

The problem is it updates the listbox for every database record, not just the one I was currently on. How would I go about adding what was checked to the listbox record for just the current user?

Hi

When you say that the data is added for all records, do you mean that if you make a choice on the checked list box form then update the list box on the customer menu form that the contents of the list box are added for every customer in the database or just in the display?

How are you getting and saving data at the moment?

Yes when I make a choice on the checked list box and have it update the listbox it updates that listbox for every record on the display. I realized this morning that when the program saves the records I create, I don't have a function that actually saves that information to the database.

I'm thinking of tossing this idea out and going with something else, like a memory game and tic tac toe. I'd work on this but it's due tomorrow night and I procrastinated too long.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.