Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 14 total
Thread Lookup and m/d
Sun, Nov 22 2009 1:18 PMPermanent Link

"Sorin H"
Hello

I have one table A, with 2 lookupfields to fields on 2 tables B and C.
The tables B and C have a master/detail relation.

I edit the A table on a dbgrid. On the insert state it's works fine and the
table get the right values.
When I reopen the A table the lookupfield from table C is blank.

Any suggestions where to look for the problem?
Thanks Sorin

Sun, Nov 22 2009 4:28 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< I have one table A, with 2 lookupfields to fields on 2 tables B and C.
The tables B and C have a master/detail relation.

I edit the A table on a dbgrid. On the insert state it's works fine and the
table get the right values. When I reopen the A table the lookupfield from
table C is blank.

Any suggestions where to look for the problem? >>

What happens between the time that the table is closed and then re-opened ?
Any modifications to the lookup fields (or any TFields) ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Sun, Nov 22 2009 5:24 PMPermanent Link

"Sorin H"

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
>
> What happens between the time that the table is closed and then re-opened
> ? Any modifications to the lookup fields (or any TFields) ?
>

No just close and open. And the values exists as foreignkeys.
I can see them on the edb manager

Thanks Sorin

Sun, Nov 22 2009 9:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< No just close and open. And the values exists as foreignkeys. I can see
them on the edb manager >>

Please send me a sample project that shows what you're seeing.  There has to
be something going on that isn't obvious, and I'm going to need to trace
what you're executing in order to find out what the cause is.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Nov 24 2009 3:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sorin


Took me a while to spot the problem.

You have a master detail relationship set up for MTblRepairDtl using dsTblRepair. You are also using MTblRepairDtl as the lookup source for LkpRepairDtl. What you need is a separate table without the master-detail link to use as the lookup for LkpRepairDtl.

Roy Lambert [Team Elevate]
Tue, Nov 24 2009 7:13 AMPermanent Link

"Sorin H"

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message

> You have a master detail relationship set up for MTblRepairDtl using
> dsTblRepair. You are also using MTblRepairDtl as the lookup source for
>  >LkpRepairDtl. What you need is a separate table without the master-detail
> link to use as the lookup for LkpRepairDtl.

Thanks

But this change the program behaviour.

On the dbgrid I insert a value to the the LkpRepair field whoes table source
is MTblRepair
and then a value for the LkpRepairDtl field but the available list should be
limited to the value on the LkpRepair field.
If I add a separate table I see all the values from MTblRepairTbl table.

Thanks Sorin

Tue, Nov 24 2009 8:17 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sorin


You need two tables one with the master detail link and a second one without it. The second one is ONLY for fetching the value of the lookup field.

Roy Lambert [Team Elevate]
Tue, Nov 24 2009 10:51 AMPermanent Link

"Sorin H"
"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
>
> You need two tables one with the master detail link and a second one
> without it. The second one is ONLY for fetching the value of the lookup
> field.

Sorry but I can't figure it.
On the dbgrid I have one collumn for editing this field and is connected to
the lookup field
How can I connect to a second table?

Thanks Sorin

Tue, Nov 24 2009 12:19 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sorin

>Sorry but I can't figure it.
>On the dbgrid I have one collumn for editing this field and is connected to
>the lookup field
>How can I connect to a second table?

Leave the grid as it is, leave the master detail as it is, drop a second table component on the form (or datamodule).  Alter LkpRepairDtl to use the new table rather than the one that's linked to a grid.

Roy Lambert [Team Elevate]
Tue, Nov 24 2009 12:43 PMPermanent Link

"Sorin H"
> Leave the grid as it is, leave the master detail as it is, drop a second
> table component on the form (or datamodule). Alter LkpRepairDtl to use the
> new table rather than the one that's linked to a grid.

Ok, I did it but now when I try to insert a new value to the LkpRepairDtl
field, I see all the values from the table.

Thanks Sorin

Page 1 of 2Next Page »
Jump to Page:  1 2
Image