-1

I enter data in grid using lists for fields. Grid connected to QGridRecords. I use two lists, short and full. I want to change LookupDataSet to one of these lists using checkbox. I can change LookupDataSet only in TForm1 constructor. Writing to LookupDataSet in event handler doesn't have effect.

object QGridRecords: TwwQuery
object QShortList: TwwQuery
object QFullList: TwwQuery

void TForm1::ChBClick(TObject *Sender)
{
        if (ChB->Checked)
        {
                QGridRecords->Close();
                QGridRecords->FieldByName("L_FIELD")->LookupDataSet = QShortList;
                QGridRecords->Open();        
        }
        else
        {
                QGridRecords->Close();
                QGridRecords->FieldByName("L_FIELD")->LookupDataSet = QFullList;
                QGridRecords->Open();        
        }
}

I tried to search answer on Internet.

1
  • I selected another decision. I write to LookupDataSet before creation of TForm1 with grid.
    – Sergey
    Nov 16 at 14:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.