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

Val error message?

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
US
Hey everyone...

I can't seem to figure this error out. I'm getting this error:
"Function Argument Value, type, or count is invalid."

on this line of code:
NumofNBAP = VAL(alltrim(ThisForm.txtNBAP.value))

It's reading a text box (txtNBAP) and converting the
text entered into a number so I can play with it later.

I have this (almost exact same) piece of code in another section of the program that works with out issue..

any ideas of what would/could be causeing this?

NumOfNBAP is decleared in the beginning as a number.. ---===///The PogoWolf\\\===---
Amateurs built the ark, Professionals built the Titanic.
 
Seems that ThisForm.txtNBAP.value isn't a character expression.

Jim
 
Or it is a character expression but with non-numeric characters in it.

 
found the issue.. I was setting the text box =1 in a sub..and not ="1" although.. I not sure how/why the system was allowing that.. but that fixed it. Thanks =) =)

---===///The PogoWolf\\\===---
Amateurs built the ark, Professionals built the Titanic.
 
Just FYI, the Value of a textbox can be of any data type, not just character.

Also, VAL() doesn't generate an error on non-numeric characters - it returns 0.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top