Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box 1

Status
Not open for further replies.

Jengo

Programmer
Apr 17, 2000
100
US
In my combobox I have this code:<br><br><br>-------------------------------------------------------<br>Private Sub Combo171_Click()<br><br>On Error Resume Next<br><br>Dim x As Integer<br><br>For x = 0 To Combo171.ListCount - 1<br>&nbsp;&nbsp;&nbsp;&nbsp;If Combo171.ListIndex = 0 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combo175.RowSource = &quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;If Combo171.Value = &quot;Desktop&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combo175.RowSource = &quot;SELECT [Problem Types].[Desktop] FROM [Problem Types]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;If Combo171.Value = &quot;Network&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combo175.RowSource = &quot;SELECT [Problem Types].[Network] FROM [Problem Types]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;If Combo171.Value = &quot;Facilities&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combo175.RowSource = &quot;SELECT [Problem Types].[Facilities] FROM [Problem Types]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>Next x<br><br>End Sub<br><br>--------------------------------------------------<br><br>I have a combo box that has values from a table that are for the time being Desktop, Network, and Facilites.&nbsp;&nbsp;And when one if selected I have a corresponding combobox change its data to match up with the correct type (Destop,Network, or Facilites).&nbsp;&nbsp;is there a way to get it to check for this data some other way that saying if combo.value = blank then do this?<br><br>I am sorry if you can't understand what I am asking it is hard to explain.<br>
 
Everyone, don't worry about it I figured it out by myself.&nbsp;&nbsp;Sorry for wasting your time.
 
I don't know if this will help anyone, but here is the fix:<br><br>Private Sub Combo2_Click()<br><br>Dim x, y As Integer<br>Dim tmp As String<br><br>For x = 0 To Combo2.ListCount - 1<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;For y = 0 To Combo2.ListCount - 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Combo2.Value = Tables![Problem Types]!Names(y) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp = &quot;SELECT [Problem Types].[&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp = tmp + Combo2.Value<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp = tmp + &quot;] FROM [Problem Types]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Combo3.RowSource = tmp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;Next y<br>Next x<br><br><br>End Sub<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top