Yep that did it. The issue was I had this after my dims :
days = txtdays.Text
months = months.Text
years = text.Text
In order to add the three values together. I moved them after the validation and it worked.
Thank you very much. Can you explain what 'Val' does? Haven't come across this...
Thanks Andy. I created a new form with your code and it works. What I want to do is give errors if :
There is no input
There is not a numerical input
The value entered is over 100
For some reason this works but I don't understand why :
If Not (IsNumeric(txtdays.Text) > 100) Or txtdays.Text =...
I want the messagebox.show to display an error message if there is no input in a label :
If (txtdays.Text > 100) And (txtdays.Text = "") Then MessageBox.Show("Please enter a value between 1 and 100")
There are no errors in the code but if there is no input in the txtdays label VBE hangs. What...
I have vba to compare values entered in a textbox.
The code validates (Visual Basic 2010 Express) but hangs when I run it and enter a non numerical value in the TxtInputDays box.
If Not (IsNumeric(TxtInputDays)) Then
MessageBox.Show("Please enter a numerical value")
ElseIf result1 >...
I've created vba to calculate the area of a parcel.
There are two valdiation checks :
If the parcels weight is less than or equal to 25
If the parcels height is less than or equal to 100
Then the formula to calculate the area is run otherwise error messages are displayed in message boxes...
Hi All
The following VBA adds an integer to another integer, if a value is entered in the textbox. If the user does not enter a value in the box i.e. it is left blank and the User Change button is clicked the VBA freezes - I'm using Visual Basic Express. What statement do I need to enter to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.