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

Error: Type mismatch

Status
Not open for further replies.

marcela24

Programmer
Feb 17, 2003
72
NL
I have a input type=text name=year in a form

Then I do:
year = Request.Form( "year" )
and test it:
if not year then

Then the program returns Type mismatch: 'year'

what can i do to correct it?
 
year may be a restricted word

other then that I would do a test such as
if year = "" then

if year then
_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
onpnt2.gif
 
Use a variable named aYear or sYear or even better form_year so you know what it is and where it should be coming from. This also avoids the reserved word conflict problem.

What I often do is:
year = Request.Form( "year" ) & ""

before the test
if year = "" then doSomething end if

This eliminates the problem of a null value for year in the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top