More than one variable doesn't know which to use


I have a module with one variable(property) of type Single. It’s scope is global.
In my button procedure, I assign the variable a numeric value, and put it into a text field as below:

GrillArea = 700.00
TextField1.Text = Val(GrillArea)

The build produces the following message:

‘There is more than one item with this name and it is not clear to which this refers’

There is only one declaration in the module. What is happening here?

You meant to use Str, not Val.

Oh, You are right. That fixed it. Thanks.

A very weird description for this kind of error. I also received it a few times and always was looking for double names.

Thank you Kern for the solution.

I hate this error message. It seems to be sort of a generic error message that translates roughly into “Hey, there’s something wrong but I’m not going to tell you what it is” when the system can’t figure out what you’re trying to do. For me,most often it’s due to a mismatch in types.

The message is often generated from a syntax error involving parentheses that make a variable appear to be an array. When I get this error message, that’s what I look for. But yes, it can be rather ambiguous.

Yes, that error message has always perplexed me.

This is my somewhat more terse version:

You never know, I might use these sort of nasty sarcastic error messages in my own software :slight_smile: