Consulting

Results 1 to 3 of 3

Thread: Solved: Combo Box help....

  1. #1
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location

    Solved: Combo Box help....

    Could someone help with this.I have the combo box that you can select a material. Then for the different materials you have different property's at different temperature.
    How do I make it so that when you select a certain material it will only work and draw info from that specific material property.?

    Here's what I got....

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Replace your form code with this

    [vba]


    Private Sub CboxMat_Change()
    If Me.CboxTemp.ListIndex <> -1 Then
    GetLookupValues
    End If
    End Sub

    Private Sub CboxTemp_Change()
    GetLookupValues
    End Sub



    Private Sub GetLookupValues()
    Select Case Me.CboxMat.Value
    Case "Sea Water":
    TxtDens.Text = Application.VLookup( _
    Val(CboxTemp.Value), Range("D5:F25"), 2, False)
    TxtVisc = Format(Application.VLookup( _
    Val(CboxTemp.Value), Range("D5:F25"), 3, False), ".000000")
    Case "Water":
    TxtDens.Text = Application.VLookup( _
    Val(CboxTemp.Value), Range("H5:J25"), 2, False)
    TxtVisc = Format(Application.VLookup( _
    Val(CboxTemp.Value), Range("H5:J25"), 3, False), ".000000")
    Case "Oil":
    TxtDens.Text = Application.VLookup( _
    Val(CboxTemp.Value), Range("L5:N25"), 2, False)
    TxtVisc = Format(Application.VLookup( _
    Val(CboxTemp.Value), Range("L5:N25"), 3, False), ".000000")
    End Select

    End Sub
    [/vba]

  3. #3
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    Thanx works 100%

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •