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

field phrase error

Status
Not open for further replies.
Jul 7, 2003
95
0
0
US
I have read other posts about this error, but this still has me stumped.

In my form I have a button entry.command.click

the command is simply thisform.refresh

I get 'field pharse' error when depressed

the trace window always points to -->thisform.refresh

What am missing or what to look at to solve this?

Thanks
 
Did you see faq184-3644 How to handle the error "field" phrase is not found in comboboxes?
 
Actually, there's a bit more to it than what's in that FAQ, although the situation Mike points out is the problem 90% of the time. I've found you can get the "Field 'phrase' not found" error if there's any inconsistency in the RowSource, including if you have the wrong kind of RowSource specified for the RowSourceType. For example, if you pick a RowSourceType of "Array", but you have a SQL Select statment in the RowSource, you'll get that error. You'll also get that error with "Fields" if there's any typo in the RowSource.


-BP (Barbara Peisch)
 
Barbara

May I amend the faq to add your findings to cover all possibilities of this type of error?


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I have no grids on the form though. There is no reference to rowsource anywhere. Its a simple data entry form. In fact, the 'field' Phrase is not found occurs upon loading the form. I have a few combo boxes and thats about it. Is this where I should be looking for problem?
 
powerprinting

Put "SET STEP ON" in the Load of the form, and follow the code to determine which line of code is causing the problem.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mike. Turns out, combo boxes will also give you this error. The problem with the error message is, it is so obscure. Trace window kept pointing at thisform.refresh .. I was looking for misspellings. At least it works now. Thanks again.
 
Mike,

You can add my stuff to your FAQ, and you don't need to show it as a quote either. Actually, I covered this error in my presentation at Whilfest a couple of years ago. Here's the full text from the whitepaper:
This is one of the more poorly worded error messages in VFP. What’s worse is when you look up this error in the online help, this is what it tells you:
The field specified in PROMPT field was not found.
You are using a command with a PROMPT clause that references an unknown field.


You probably weren’t doing anything at all with a PROMPT command when you got this error, and you’re really scratching your head wondering what on earth this means. This error should have been worded “RowSource is invalid”, because that’s what it’s really trying to tell you.

If you happened to search the knowledge base instead, you probably found article Q133024, which does help you solve this problem. That article says:

This is caused by incorrect syntax in the list of fields in the RowSource property. The documentation and online Help imply that the correct way to list fields in this property is:

Table1.field1, Table1.field2, Table1.field3, ...

This is incorrect. The correct syntax is:

Table1.field1, field2, field3, ...

Any deviation from this syntax (using an expression instead of a field name, trying to use fields from multiple or related tables, and so on) results in the same error message.


Keep in mind that any typo in the field name list causes this error to occur. And while we’re talking about field names, you should know that just specifying the alias without explicitly listing each field doesn’t work either.

Another cause of this error is using a RowSource of “2 – Alias” for a combobox or listbox when the alias isn’t open in the current data session.
I’ve even seen this error occur when I had left the RowSourceType as “3 – SQL Statement”, but changed the RowSource to an array.

PowerPrinting,

Mike's FAQ was discussing combos and lists. I'm not sure why you think a grid would be the problem.

FWIW, I've been complaining to the Fox doc team about this message and the help topic (or non-help in this case) that goes along with it, since VFP 8 was in alpha. They still haven't even changed the docs.



-BP (Barbara Peisch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top