Thanks for the reply, Ian. I rarely use aliases in reports. That's a bad habit, in my book. However, I did figure out the problem (check my response to Naomi in this thread), so I'm rolling on now. Thanks again.
>Hi Russell.
>
>The report designer hides table aliases on simple fields, so if you look at the report in the designer the textbox might say company, but if you double click it to bring up properties you might see something like query.company. If there any chance that you changed the alias for the SQL Select and now the report is looking for the wrong alias?
>
>Ian Simcock.
>
>
>
>>I was designing a report and in the command window I executed the SQL statement to retrieve the data from the 4 or 5 tables involved. One field is COMPANY. It comes from the customer table related on CustNo from the main table. No problem. I can then do a preview on the report and it works fine. So I take the same code and run it from the program and when I execute the report it says "variable COMPANY is not found." I have a BROWSE NORMAL command right after the SQL statement and right before the call to the report. The COMPANY field is there as clear as day, yet I get this error. It's a bit mystifying at the moment. Anyone have any thoughts?