Field Validation Not working

Hi,
I'm using vbsript in an HTML page. I want to first determine if the texbox (AGE) is empty and then determine if the value used is only numeric. If numeric does the number fall between 0 and 64, then I will set the value to to form17. I think it's the IsNumeric function and nested If statment that is causing the problem. Is there a better way to do this? I have assigned 500 point value because the request urgent. As always, thanks for your help!

Is this the exact code you're using? are you getting a particular error message? I see a few syntax errors that, in the absence of more information, I assume could be causing your problem. Try the following:

form17 = main.Age.Value
If IsEmpty(main.Age.Value) Then
MsgBox ("CAN NOT CONTINUE - MISSING AGE")
Exit Sub
ElseIf Len(main.Age.Value) = 0 Then
MsgBox ("CAN NOT CONTINUE - MISSING AGE")
Exit Sub
ElseIf IsNumeric(main.Age.Value) Then
If (main.Age.Value > 0) And (main.Age.Value <= 64) Then
form17 = main.Age.Value
Else
MsgBox ("CAN NOT CONTINUE - AGE MUST BE BETWEEN 0 AND 64")
Exit Sub
End If
Else
MsgBox ("CAN NOT CONTINUE - USE ONLY NUMERIC VALUES FOR THE AGE")
Exit Sub
End If

Note the addition of "Then" at the end of an "ElseIf" and the following "If" lines. And the reformatting of your "If (main.Age.Value) > 0 And <= 64" line.

Introduction
In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function. While writing that article I realized that no o…

Here are a few simple, working, games that you can use as-is or as the basis for your own games.
Tic-Tac-Toe
This is one of the simplest of all games.
The game allows for a choice of who goes first and keeps track of the number of wins for…

Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…