white_flag
07-08-2010, 12:46 AM
good morning
I have the following problem: I have two comboboxes that has to be like this
Combo 1
null
TextforCombo1
TextforCombo1
TextforCombo1
TextforCombo1
Combo 2
null
TextforCombo2
TextforCombo2
TextforCombo2
TextforCombo2
then I like to make then work togheter and I give then some logical statements:
Dim Title1 As String, Title2, Title3, Title4
If Me.Controls("ComboBox1").ListIndex > 0 And Me.Controls("ComboBox2").ListIndex > 0 Then
Title1 = Title1 & Me.Controls("ComboBox1").Text
Title2 = Title2 & Me.Controls("ComboBox2").Text
Call FillBM("book1", vbCrLf & Title1 & " + " & Title2)
Title1 = ""
Title2 = ""
ElseIf Me.Controls("ComboBox1").ListIndex = 0 And Me.Controls("ComboBox2").ListIndex > 0 Then
Title3 = Title3 & Me.Controls("ComboBox2").Text
Call FillBM("book1", vbCrLf & Title3)
ElseIf Me.Controls("ComboBox1").ListIndex > 0 And Me.Controls("ComboBox2").ListIndex = 0 Then
Title4 = Title4 & Me.Controls("ComboBox1").Text
Call FillBM("book1", vbCrLf & Title4)
Else: Me.Controls("ComboBox1").ListIndex = 0 And Me.Controls("ComboBox2").ListIndex = 0
Call FillBM("book1", "")
End If
this take the text from Combo 1 and Combo 2 and put it in an bookmark together or not depends what I am choosing. But not the problem: Wen I select some item from the first combobox nothing is happening and the code delete the item from combo 1 and stay like this. If I select an item from the second combo, it is working fine ..and then I can use the combo 1 (it will gone act like the way I want)..so What it is wrong here?
in attachment is an example of the way of the comboboxes are reacting.
I have the following problem: I have two comboboxes that has to be like this
Combo 1
null
TextforCombo1
TextforCombo1
TextforCombo1
TextforCombo1
Combo 2
null
TextforCombo2
TextforCombo2
TextforCombo2
TextforCombo2
then I like to make then work togheter and I give then some logical statements:
Dim Title1 As String, Title2, Title3, Title4
If Me.Controls("ComboBox1").ListIndex > 0 And Me.Controls("ComboBox2").ListIndex > 0 Then
Title1 = Title1 & Me.Controls("ComboBox1").Text
Title2 = Title2 & Me.Controls("ComboBox2").Text
Call FillBM("book1", vbCrLf & Title1 & " + " & Title2)
Title1 = ""
Title2 = ""
ElseIf Me.Controls("ComboBox1").ListIndex = 0 And Me.Controls("ComboBox2").ListIndex > 0 Then
Title3 = Title3 & Me.Controls("ComboBox2").Text
Call FillBM("book1", vbCrLf & Title3)
ElseIf Me.Controls("ComboBox1").ListIndex > 0 And Me.Controls("ComboBox2").ListIndex = 0 Then
Title4 = Title4 & Me.Controls("ComboBox1").Text
Call FillBM("book1", vbCrLf & Title4)
Else: Me.Controls("ComboBox1").ListIndex = 0 And Me.Controls("ComboBox2").ListIndex = 0
Call FillBM("book1", "")
End If
this take the text from Combo 1 and Combo 2 and put it in an bookmark together or not depends what I am choosing. But not the problem: Wen I select some item from the first combobox nothing is happening and the code delete the item from combo 1 and stay like this. If I select an item from the second combo, it is working fine ..and then I can use the combo 1 (it will gone act like the way I want)..so What it is wrong here?
in attachment is an example of the way of the comboboxes are reacting.