DBLookupComboBox question
- From: "swansnow" <schultz@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: 27 Oct 2005 07:03:40 -0700
I'm sure this has been asked multiple times, but I couldn't find any
answers when I searched. Maybe I didn't use the right keywords...
I'm trying to use a DBLookupComboBox for the following problem, but it
doesn't seem to be working. I'm not sure if the DBLookupComboBox is the
right component to be using, or if I'm just confused about how to use
it.
I have two tables. I want the box to display a list of names from one
table. I want to select a name, and have the ID that goes with that
name be saved into the second table. In effect, I'm saving a foreign
key, but selecting a meaningful name from a list.
For the sake of example, the table I'm reading from is table1, and the
table I'm saving to is table2
I tried this:
Datasource -> dsTable2
DataField -> recordID
ListSourse -> dsTable1
ListField -> recordName
keyField -> recID (from table1)
The behavior I see is the combobox is populated properly, but when I
select something, the edit part doesn't display anything. Table1 is
active (as evidenced by the list being correct), and table2 is in edit
state, so it should show up.
Now, I'm guessing it has something to do with the fact that I'm saving
to an integer field (the recordID), so it doesn't know what to display.
I would rather not put a name field into table2 since it's not needed
and could cause confusion in the future.
Am I misunderstanding how to use the lookup component, or is there no
component that does what I want? (btw, I have some of the Raize and
devExpress components, but I'm not as familiar with them.)
-Corinna
.
- Follow-Ups:
- Re: DBLookupComboBox question
- From: DB-1
- Re: DBLookupComboBox question
- From: Bruce Roberts
- Re: DBLookupComboBox question
- Prev by Date: generato field / Apply event
- Next by Date: Re: DBLookupComboBox question
- Previous by thread: generato field / Apply event
- Next by thread: Re: DBLookupComboBox question
- Index(es):
Relevant Pages
|