Recent

Author Topic: Finding stuff in Database  (Read 1270 times)

Zvoni

  • Hero Member
  • *****
  • Posts: 2608
Re: Finding stuff in Database
« Reply #15 on: August 13, 2024, 11:27:25 am »
I found it.

I never selected the datasource in the DBlookupcombobox.
I am an idiot.

Ok, now that i can verify the entry exists, how do I show all the fields for that tracking number into a grid?

Many thanks

Peter
A successful "Locate" moves the cursor to THAT position.
Just access the other fields

Aircode!!
Code: Pascal  [Select][+][-]
  1. ....
  2. If MyBool Then Begin
  3.  Tedit42.Text:=dblookupcombobox3.DataSource.DataSet.FieldByName('SomeOtherField').AsString); //Or show it in a Label, Grid, wherever
  4. end;
Or use a For-Loop running through the Dataset-Fields accessing by index
Code: Pascal  [Select][+][-]
  1. ....
  2. If MyBool Then Begin
  3.  For i:=0 To dblookupcombobox3.DataSource.DataSet.Fields.Count -1 Do Begin
  4.     Writeln(dblookupcombobox3.DataSource.DataSet.Fields[i].AsString); //Or show it in a Label, Grid, wherever
  5.  End;
  6. end;
« Last Edit: August 13, 2024, 11:38:54 am by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018