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

Type mismatch error

Status
Not open for further replies.

nimishauk

Programmer
Mar 18, 2003
12
ZA
HI

When an user edits a text box on the page which has a default value displayed as 0, and enters no value, get a type mismatch error. Even though I try to set the value back to 0 no luck
Code
nTotalTime = (nActualHours * 60) + nActualMins
nActualMins = nTotalTime mod 60

Ani deas?
Nimisha
 
' CHECK THE INPUT WAS A NUMBER
if(IsNumeric( yourValue ) )then
'CAST TO INTEGER
yourValue = CINT(yourValue )
else

Response.write "user didn't enter a number"

end if

HOPE THIS HELPS
 
can you post a little more of your code. I'm guessing that you are trying to treat a string as a number....

nActualHours = request("actHours")
if isNumeric(nActualHours) then
nActualHours = cInt(nAcutalHours)
else
nAcualHours = 0
end if

Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
 
I've been kicking myself. I was not calling the right variable hence the error.
Ta guys, appreciate the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top