Board index » delphi » Lookup won't work properly

Lookup won't work properly

Hi!

I am using SQL to display my records in a DBGrid.
Then I have added a field which is a lookupfield. The lookup works fine AT
FIRST, The records are displayed in the DBGrid and everything works fine..

until I scroll the Grid... Then the original fields remain, while the
lookup field disappears, its almost like the top and the bottom of the
DBGrid "wipes" the fieldvalues off.

If I have, let's say a DBGrid with the height of 10 lines, then the 10
first records are shown when I open the SQL. If I then scroll down to look
at the 11th record, the line is blank, while the 1st record disappears
over the top (naturally). When I scroll back again to look at the 1st
record, it's gone, the line is empty, wiped off. Its frustrating.

Is there a way to make this work?? Repaint the thing, refresh it or
whatever??? (Refresh and repaint on the DBGrid does'nt work).

Thanks

BAJ

 

Re:Lookup won't work properly


Hi,

I'm having a similar problem with a DBLookupCombo using SQL (Access
dataabse).  The first 3 or 4 times I click on the down arrow of the
lookup combo box, it displays a different number of lines.  They all
belong to the lookup table, but don't seem to want to display at the
same time.  Only after the 3rd or 4th time they all display.  I wonder
what this could be, a refresh problem?

Cheers,

Paul

On Mon, 21 Apr 1997 11:27:49 +0200, Birger Alexander Johansen

Quote
<birg...@stud.ntnu.no> wrote:
>Hi!

>I am using SQL to display my records in a DBGrid.
>Then I have added a field which is a lookupfield. The lookup works fine AT
>FIRST, The records are displayed in the DBGrid and everything works fine..

>until I scroll the Grid... Then the original fields remain, while the
>lookup field disappears, its almost like the top and the bottom of the
>DBGrid "wipes" the fieldvalues off.

>If I have, let's say a DBGrid with the height of 10 lines, then the 10
>first records are shown when I open the SQL. If I then scroll down to look
>at the 11th record, the line is blank, while the 1st record disappears
>over the top (naturally). When I scroll back again to look at the 1st
>record, it's gone, the line is empty, wiped off. Its frustrating.

>Is there a way to make this work?? Repaint the thing, refresh it or
>whatever??? (Refresh and repaint on the DBGrid does'nt work).

>Thanks

>BAJ

Re:Lookup won't work properly


I found the solution to my problem, it the lookup-table's MasterSource is
set to a value different from nil, the lookup won't work. I guess the
SQLTable can't lookup a value if the lookuptable is "locked" to another
table.

BAJ

Other Threads