abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
i face two problem first the combobox not populate data rowsource despite the same code with a little difference just change the column and the name combobox
the second when i choose item any combobox or toghether the summing values don't change it stay one fixing value
theses my code:
this line If .List(x, 2) = Me.ComboBox3 i change in combobox1,2 =If .List(x, 0) = Me.ComboBox1 & If .List(x, 1) = Me.ComboBox2
they works but with combobox 3 not
i hope somebodey help
i face two problem first the combobox not populate data rowsource despite the same code with a little difference just change the column and the name combobox
the second when i choose item any combobox or toghether the summing values don't change it stay one fixing value
theses my code:
VBA Code:
Private Sub ComboBox3_Change()
Dim i, x As Integer
Dim mylist As String
With Me.ListBox1
For i = 1 To .ListCount - 1
For x = 1 To .ListCount - 1
If .List(x, 2) = Me.ComboBox3 Then
For c = 0 To 6
mylist = .List(x, c)
.List(x, c) = .List(i, c)
.List(i, c) = mylist
Me.ListBox1.Selected(i) = True
Next c
End If
Next x
Next i
Dim m As Integer
Dim sum, sum1 As Double
For m = 1 To .ListIndex()
sum = sum + Val(.List(m, 3))
sum1 = sum1 + Val(.List(m, 4))
Next m
Me.TextBox1 = Format(sum1, "####.00")
Me.TextBox2 = Format(sum, "####.00")
End With
End Sub
this line If .List(x, 2) = Me.ComboBox3 i change in combobox1,2 =If .List(x, 0) = Me.ComboBox1 & If .List(x, 1) = Me.ComboBox2
they works but with combobox 3 not
i hope somebodey help