[quote]Originally posted by Marco Kalter:
You have to understand that in QBE mode, with Allow Operators = True, the fields do not have values. [/quote]Of course, I said about values of the QBEDefinition (QBEDefinition->Fields[i]->Value).
However if Allow Operators = True then for all lookup-fields values of the QBEDefinition are equal Null. In my opinion it is bad news :-) and I hope you will find a better solution in the future.
To correct this problem I have used now the BeforeQBE event. I have found and cleared values of KeyFields for all lookup fields. For example (simplified version):
for(int i=0;i<Sender->FieldCount;i++)
{
TField *f=Sender->Fields->Fields[i];
if(f->FieldKind == fkLookup)
{
TQBEField *QBEField=Sender->
QBEDefinition->FieldByName(Sender->
Fields->Fields[i]->FieldName);
AnsiString s=QBEField->FieldName;
if(QBEField->Queryable)
{
if(f->LookupKeyFields != "")
{
TList *lKeyFs= new TList();
Sender->GetFieldList(lKeyFs,
f->LookupKeyFields);
for(int j=0;j<lKeyFs->Count;j++)
{
TField *fl=(TField *)lKeyFs->Items[j];
Sender->QBEDefinition->FieldByName
(fl->FieldName)->Value="";
}
delete lKeyFs;
}
}
}
}
It is clumsy solution but, IMHO, it is better of current solution :-).