Hi everyone, I need some help with the following it is quiet simple really but its been really stressing me out as I have spent many hours trying to figure out how to do it. I have a form which is databinded to a table, in the form there is a listbox, 2 buttons and 2 textboxes. The idea of the program is simple, in the listbox it shows the description of the item (in any random order), the two textboxes are binded to the database and the first textbox shows the description of the item, and the second textbox shows a specific number which is related to the item.
Also the buttons are placed next to the listbox and their role is simple, one is an ‘up’ button and one is a ‘down’ button. They navigate through the chosen item in the listbox, however they also move on to the next/previous item in the textbox, for example I have included the following coding which is with the down button:
dbindingmanager.Position += 1
'Make the selected item go lower in listbox1
If Me.listbox1.SelectedIndex <> Me.listbox1.Items.Count - 1 Then
Me.listbox1.SelectedIndex = Me.listbox1.SelectedIndex + 1
End If
The part I need help with is there a way in which the item in the listbox matches the item in the textbox, the part im having trouble with is the up and down buttons only move on to the next/previous record in the textbox and not matching the same item which is shown in the listbox, I need the item that is showing in the listbox to be the same as the item in the textbox. I have included a print screen of my program, if you can give me any suggestions or help me out I would really appreciate it.
Thanks alot.
(By the way the above is incorrect as I have entered the text in the two textboxes) but I hope you get my drift.
Also the buttons are placed next to the listbox and their role is simple, one is an ‘up’ button and one is a ‘down’ button. They navigate through the chosen item in the listbox, however they also move on to the next/previous item in the textbox, for example I have included the following coding which is with the down button:
dbindingmanager.Position += 1
'Make the selected item go lower in listbox1
If Me.listbox1.SelectedIndex <> Me.listbox1.Items.Count - 1 Then
Me.listbox1.SelectedIndex = Me.listbox1.SelectedIndex + 1
End If
The part I need help with is there a way in which the item in the listbox matches the item in the textbox, the part im having trouble with is the up and down buttons only move on to the next/previous record in the textbox and not matching the same item which is shown in the listbox, I need the item that is showing in the listbox to be the same as the item in the textbox. I have included a print screen of my program, if you can give me any suggestions or help me out I would really appreciate it.
Thanks alot.
(By the way the above is incorrect as I have entered the text in the two textboxes) but I hope you get my drift.