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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BeforeUpdate event Compile Error

Status
Not open for further replies.

f64

Technical User
May 23, 2003
24
US
Numeric values are being entered into a textbox on a userform. I need to check that they are in increments of five. I am trying to use the BeforeUpdate event for the textbox to call a subroutine that will check the value and round up if necessary. The textbox is tbHIVRNA.

Private Sub tbHIVRNA_Change()

NewVal = Val(tbHIVRNA.Text)
If NewVal >= sbHIVRNA.Min And _
NewVal <= sbHIVRNA.Max Then _
sbHIVRNA.Value = NewVal

Call Check_Format(tbHIVRNA)
' Call Round_Up_To_Five(tbHIVRNA)

End Sub

Private Sub tbHIVRNA_BeforeUpdate(ByValTrue As MSForms.ReturnBoolean)
Call Round_Up_To_Five(tbHIVRNA)
End Sub

This generates a compile error "Procedure Declaration Does Not Match Description of Event or Procedure Having the Same Name". Isn't tbHIVRNA_BeforeUpdate a valid event?
 
Private Sub tbHIVRNA_BeforeUpdate([!]ByVal Cancel[/!] As MSForms.ReturnBoolean)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top