Jump to content

Unidblookpupcombobox problem


erguti63

Recommended Posts

My suggestion is to describe your problem in complete detail.

ok, I'll try to describe the problem. I have a form with a Tibquery called "qrycolor" with "select _key, color by color order from Color," with an associated TDatasource called "dscolor" a Tunidblookupcombobox called "combocolor" and properties Listsource = Dscolor,Listfield = Color and KeyField = _Key.

In the event of the form Uniformcreate run qrycolor.open , when clicked on Unidblookupcombobox, displays, but only displays one record.

I apologize for my bad English, I hope I have understood and can help me

Thanks in advance.

Link to comment
Share on other sites

  • Administrators

ok, I'll try to describe the problem. I have a form with a Tibquery called "qrycolor" with "select _key, color by color order from Color," with an associated TDatasource called "dscolor" a Tunidblookupcombobox called "combocolor" and properties Listsource = Dscolor,Listfield = Color and KeyField = _Key.

In the event of the form Uniformcreate run qrycolor.open , when clicked on Unidblookupcombobox, displays, but only displays one record.

 

Thanks for info.

 

Can you specify your uniGUI version?

Link to comment
Share on other sites

  • Administrators

Problem is related to IBQuery which doesn't fully fetch all records. uniGUI needs to know number of records in advance. (RecordCount)

 

Workaround:

 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  bdprincipal.Open;
  ibvehiculos.Open;
  qrycolor.Open;
  qrycolor.Last; //<-------- added
  qrymarcas.Open;



end;

Link to comment
Share on other sites

Problem is related to IBQuery which doesn't fully fetch all records. uniGUI needs to know number of records in advance. (RecordCount)

 

Workaround:

 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  bdprincipal.Open;
  ibvehiculos.Open;
  qrycolor.Open;
  qrycolor.Last; //<-------- added
  qrymarcas.Open;



end;

Thanks, I'll try.

Link to comment
Share on other sites

Thanks, it works perfectly ... now I get another problem, when I select a record brings me back to the code assigned to the target field is not valid .. any suggestions?

I have found that the value stored in DataField is not KEYFIELD property, it saves Listfield property.

The dblookupcombobox is integrated in the property editor of the dbgrid.

Thanks in advance

Link to comment
Share on other sites

When used as an Editor, a DBLookup control should only have ListSource and ListField properties. DataSource and DataField should not be used. In this mode DBLookup simply works as a simple list to select values for respected field.

Ok Thanks, I just checked.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...