DBLookupComboBox --HELP!--

DBLookupComboBox --HELP!--

Post by Dan L » Fri, 17 May 1996 04:00:00



We're currently using a DBLookupComboBox in order to bring up a
list of items for selection.

We are specifying no Datasource and no datafield but are
obviously specifying the ListSource, ListField and KeyField
properties. Basically, we don't want to assign the selected
keyValue  to somewhere in the database.

The PROBLEM however, is that once you have selected something in
the DBLookupComboBox you cannot go back to having nothing
selected.  CAN ANYBODY HELP???

Also, can you add items to the list at run-time in addition to
those obtained from the LookupSource? For instance, if were
effectively using the DBLookUpCombo as a filter can we add 'ALL'?

Thanks In Advance,

Dan.

 
 
 

DBLookupComboBox --HELP!--

Post by Benny Brouw » Sat, 18 May 1996 04:00:00


Dan Lee wrote in a message to All:

 DL> The PROBLEM however, is that once you have selected something in
 DL> the DBLookupComboBox you cannot go back to having nothing
 DL> selected.  CAN ANYBODY HELP???

 DL> Also, can you add items to the list at run-time in addition to
 DL> those obtained from the LookupSource? For instance, if were
 DL> effectively using the DBLookUpCombo as a filter can we add 'ALL'?

Maybe not so nice but I add an empty record and if necessary a record
containing 'ALL' to my lookup tables.

Benny Brouwer
--
| Standard disclaimer: The views of this user are strictly his own.

 
 
 

DBLookupComboBox --HELP!--

Post by Steve Schaf » Tue, 21 May 1996 04:00:00



Quote:

>Dan Lee wrote in a message to All:

> DL> The PROBLEM however, is that once you have selected something in
> DL> the DBLookupComboBox you cannot go back to having nothing
> DL> selected.  CAN ANYBODY HELP???

> DL> Also, can you add items to the list at run-time in addition to
> DL> those obtained from the LookupSource? For instance, if were
> DL> effectively using the DBLookUpCombo as a filter can we add 'ALL'?

>Maybe not so nice but I add an empty record and if necessary a record
>containing 'ALL' to my lookup tables.

>Benny Brouwer
>--
>| Standard disclaimer: The views of this user are strictly his own.

Another approach is to simply use the standard combo box and load it
manually.  It only takes a few lines of code which can be inserted in
a FormCreate event handler:

  combobox.Items.Clear;
  combobox.Items.Add( '' ); {add a blank entry}
  table.First;

  while table.Eof = False do
    begin
      combobox.Items.Add( tableField.Value );
      table.Next
    end;

The only part of this I haven't actually tried myself is adding a
blank entry to a combo box, But if it doesn't work you could use "ALL".

Steve

 
 
 

1. Getting Result From DBLookupComboBox: HELP!

Hi Delphi Gurus -

I apologize in advance if this is confusing and wordy but the problem I
need to solve is confusing (and wordy).

I am working on an app let's say it's a perpetual inventory system for
roll materials. Each roll is unique and there are *many* rolls which are
similar in type, dimension, cost, etc. I want to make the roll receipt
entry easy for the users and would like for them to enter the common
information once but let the app do the work entering (and sequential
numbering the rolls). Any help or advice on which direction to go will be
greatly appreciated. Thanks in advance if anyone can help.

Example:

We receive 100 rolls of high-gloss 5"x10000'. Rather than have my users
press the add button 100 times, I would like for the app to add the
records "in the background" where the users just put in type, width,

DBLookupCombo so they don't have to know what the material code is for the
type.

I already have the behind the scenes logic working as long as they know
the item code (right now they type the code into an edit box and the
"behind the scenes logic" get's it done ). I would like to use a
DBLookupComboBox to get up the material code.

The problem is I can't figure out how to get the resulting material code
into an edit box which is needed for my "behind the scenes logic". It
appears that the result is placed right into the field of the current
record but this won't work.

Can anybody help or tell me a place to look? I have tried regular the
DBComboBox and this won't give me the code (it only gives me the type
which I don't want to use to populate the tables - size and maintenance
issues).

Thanks again if anybody has any advice.

Doug

2. Consulting Practice PARTNER Wanted

3. Help with DBLookupComboBox (Delphi 4)

4. pgsql/ oc/src/sgml/ref/copy.sgml rc/backend/co ...

5. DBLookupComboBox Crashes With Intellimouse...Help!

6. Clipper vs. Foxbase vs. dBASE

7. Please help me - I need a real DBLookupComboBox

8. pgsql/src/interfaces/jdbc/org/postgresql/jdbc2 ...

9. DBLookupComboBox in DBCtlGrid Help...

10. DBLookupCombobox question

11. component like DBLookupComboBox

12. DBLookupComboBox in two master-detail relations