Board index » delphi » One of those Little Things: How to get TDBLookupComboBox to show up with active record?

One of those Little Things: How to get TDBLookupComboBox to show up with active record?

Why doesn't the TDBLookupComboBox get up showing the active record of the
dataset and does the user have to click on it first??

CU
WS

 

Re:One of those Little Things: How to get TDBLookupComboBox to show up with active record?


Wim,
I just checked one of my apps, and the lookupcombo does show the
chosen record in the lookup dataset. I'm using D4P against a Paradox
db. The lookupcombo is attached to a code field in the main query
dataset; it displays the corresponding description of the code. The
lookup dataset has a code field and a description field.

How is yours connected?

Dan

On Tue, 16 Nov 1999 12:05:17 +0100, "Wim Smit" <w.s...@magnacarta.nl>
wrote:

Quote
>Why doesn't the TDBLookupComboBox get up showing the active record of the
>dataset and does the user have to click on it first??

>CU
>WS

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control: Consulting, Software,
and the only comprehesive textbook on this subject.
visit us at www.cmdcsystems.com
[Remove the SPAM from my e-mail address]

Re:One of those Little Things: How to get TDBLookupComboBox to show up with active record?


Quote
>I just checked one of my apps, and the lookupcombo does show the
>chosen record in the lookup dataset.

I forget one little detail: the properties datasource and Datafield are NOT
set! I just use a lookup as a sort of positioner in the table (like a DBgrid
really)..when the user presses OK I get the chosen record by
listsource.fieldvalues['recid']. This works all fine, except that thing when
the dialog is just shown: the Lookup is empty.

Quote
> I'm using D4P against a Paradox
>db. The lookupcombo is attached to a code field in the main query
>dataset; it displays the corresponding description of the code. The
>lookup dataset has a code field and a description field.

>How is yours connected?

Using DP5 and Paradox and 1 table
Quote
>On Tue, 16 Nov 1999 12:05:17 +0100, "Wim Smit" <w.s...@magnacarta.nl>
>wrote:

>>Why doesn't the TDBLookupComboBox get up showing the active record of the
>>dataset and does the user have to click on it first??

CU
WS

Re:One of those Little Things: How to get TDBLookupComboBox to show up with active record?


Wim,

The only thing I can think of offhand would be to click the
lookupcombo with code, if a mouse click does what you need. Something
like:

        MyLookupCombo.click;

put this code where it would get executed at the right time, e.g. in
the OnShow event of the form. This is often a usable substitute for
clicking with the mouse.

HTH,
Dan

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control: Consulting, Software,
and the only comprehesive textbook on this subject.
visit us at www.cmdcsystems.com
[Remove the SPAM from my e-mail address]

Re:One of those Little Things: How to get TDBLookupComboBox to show up with active record?


Quote
>The only thing I can think of offhand would be to click the
>lookupcombo with code, if a mouse click does what you need.

I found the answer somewhere in this group:

just set the KEYVALUE of the ComboBox :

tblCardstatus.Open;
luCardstatus.KEYVALUE := tblCardstatus.FieldValues['cardstatusid'];

Nice, nice
CU
WS

Other Threads