Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Hayfa Khan   on Sep 12 In MS Office Category.

  
Question Answered By: Janis Hart   on Sep 12

Never mind.... I found the following code  corrects my problems (it only accepts
"Valid Codes" eliminating the need for the message):

Private Sub tbT_Code1_Change()
If tbT_Code1.Value <= iRetCodeMax And tbT_Code1.Value >= iRetCodeMin Then
iRetCode1 = tbT_Code1.Value
Else
iRetCode1 = 0
sReason1 = ""
tbT_Reason1 = sReason1
tbT_Code1 = ""
Exit Sub ' Force the error  trap to reset
End If
If iRetCode1 <> 0 Then
sReason1 = Application.WorksheetFunction.VLookup(iRetCode1,
Range("RetCode_Lookup"), 2, False)
tbT_Reason1 = sReason1
End If
End Sub

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem with simple error trap Or get search suggestion and latest updates.


Tagged: