diff --git a/ba/ba7100.cpp b/ba/ba7100.cpp index 4824c6682..28bee9ecd 100755 --- a/ba/ba7100.cpp +++ b/ba/ba7100.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -433,14 +434,29 @@ TFilter_expr::TFilter_expr(TAutomask& m, int logicnum, const char* expr) logicnum = LF_TABCOM; // Niente errori fatali, se possibile const TRectype rec(logicnum); - for (int i = 0; i < numvar(); i++) if (!rec.exist(varname(i))) - { - _error = 883; - TString msg; - msg.format(FR("Il campo %s non appartiene al file %d"), varname(i), logicnum); - print_error(msg); - break; - } + + for (int i = 0; i < numvar(); i++) + { + const TFixed_string name(varname(i)); + int num = logicnum; + bool ok = rec.exist(name); + + if (!ok) + { + const TFieldref f(name, 0); + int num = table2logic(f.id()); + const TRectype join(num); + ok = join.exist(f.name()); + } + if (!ok) + { + _error = 883; + TString msg; + msg.format(FR("Il campo %s non appartiene al file %d"), varname(i), logicnum); + print_error(msg); + break; + } + } } }