Hallo Leute,
ich habe ein problem mit meiner lisbox... Ich habe eine Kundendatenbank die in einer Listbox angezeigt wird. Ich möchte nun Datensätze über doppelklick editieren. Dies funktioniert auch teilweise. Wenn ich einen datensatz anklicke öffnet sich eine neue Userform mit verschiedenen Textboxen. Der Datensatz wird aber erst nach 2 x Doppelklicken eingelesen. Wenn ich einmal Doppelklicke kommt entweder nichts oder der falsche Datensatz. Kann mir jmd helfern... hier mein code
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Kundendatenbearbeiten.Show
For intindex = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(intindex) = True Then
Kundendatenbearbeiten.TextBox1.Value = ListBox1.List(intindex, 0)
Kundendatenbearbeiten.TextBox2.Value = ListBox1.List(intindex, 4)
Kundendatenbearbeiten.TextBox3.Value = ListBox1.List(intindex, 5)
Kundendatenbearbeiten.TextBox4.Value = ListBox1.List(intindex, 1)
Kundendatenbearbeiten.TextBox5.Value = ListBox1.List(intindex, 2)
Kundendatenbearbeiten.TextBox6.Value = ListBox1.List(intindex, 6)
Kundendatenbearbeiten.TextBox7.Value = ListBox1.List(intindex, 7)
Kundendatenbearbeiten.TextBox8.Value = ListBox1.List(intindex, 9)
Kundendatenbearbeiten.TextBox9.Value = ListBox1.List(intindex, 8)
Kundendatenbearbeiten.TextBox10.Value = ListBox1.List(intindex, 10)
Kundendatenbearbeiten.TextBox11.Value = ListBox1.List(intindex, 11)
Kundendatenbearbeiten.TextBox12.Value = ListBox1.List(intindex, 12)
Kundendatenbearbeiten.TextBox13.Value = ListBox1.List(intindex, 13)
Kundendatenbearbeiten.TextBox14.Value = ListBox1.List(intindex, 14)
Kundendatenbearbeiten.TextBox15.Value = ListBox1.List(intindex, 15)
Kundendatenbearbeiten.ComboBox1.Value = ListBox1.List(intindex, 3)
Kundendatenbearbeiten.ComboBox2.Value = ListBox1.List(intindex, 16)
End If
Next intindex
End Sub Vielen Dank |