Code Assesment

I have a Userform that Pulls Data from an excel sheet( Ie Data base)  for editing purposes,

On the user from if the text boxes have different values it is supposed to look up the Torque value that is on Sheet29 ( A different sheet other than the Data Base)

in this case the way this reads is  If the flange class is 150 and the Flange material is stainless,  and the Gasket type is Flex and the bolt size is 1/2″ then go to the Sheet29 Cell K5 and put that value is TextBox 10.

Private Sub TextBoxB10_Change()
'TB11 As Range 'Flange Class
'TB12 As Text ' Flange Material
'TB28 As Text 'Gasket Type
'TB14 As Text 'Bolt Size
'TB10 is Torque Value
If Me.TextBoxB11.Value = 150 _
And Me.TextBoxB12.Value = Stainless _
And Me.TextBoxB28.Value = Flex Or RTJ _
And Me.TextBoxB14.Value = "1/2""" _
Then Me.TextBoxB10.Value = Sheet29.Range("K5") _
Else 'Me.Textbox10.Value = ""
End Sub

Can anyone tell me why this don’t work? Cause it don’t but i would think that it would.  i would expect that if i brought up a “line” that had all those values in it when i clicked into that TB10 it should update it with the values. I don’t get any errors it just flat will not put in the value in K5.  Sheet29 is in the same workbook as the userfrom and the Data base from which it pulls information from

i am think that I may have to I have a feeling that i will need to set an Object Variable or something like that.

 

New Member Asked on March 22, 2017 in VBA: User Forms.
Add Comment
0 Answer(s)
  • Found this useful?

    Please share using the share button above.

    If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.

    Found the answer useful and wants to credit the user, then vote the answer (vote up).

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.