Thread View: borland.public.delphi.database.win32
2 messages
2 total messages
Started by Mark
Tue, 06 Nov 2007 11:38
DBGrid and two lookup fields
Author: Mark
Date: Tue, 06 Nov 2007 11:38
Date: Tue, 06 Nov 2007 11:38
23 lines
1872 bytes
1872 bytes
I have a DBGrid where the users can insert/edit records. There are two lookup fields in the record. The first one is a string value and is part of the record's key. The second one is a BCD field and is not part of the key. If the user chooses a value from the first lookup field and then tries to dropdown the second lookup, Delphi somehow tries to do a lookup on the lookup table of the _second_ lookup field with the value of the first lookup field, which of course excepts being of different types. However, if the user first selects from the second lookup and then drops down the first lookup field everything works just fine. Lookups as such are working. Both lists show the correct values. There is just some kind of cross reference when having selected a value from the first lookup. I have been deleting and redefining fields, columns and so on, but Delphi persists in this behaviour. Where is this strange link coming from. Where can I find some way to work around this ? Thanks.
Re: DBGrid and two lookup fields
Author: Wayne Niddery (TeamB)
Date: Tue, 06 Nov 2007 15:41
Date: Tue, 06 Nov 2007 15:41
28 lines
2436 bytes
2436 bytes
"Mark" <x@x> wrote in message news:47305205$1@newsgroups.borland.com... > > If the user chooses a value from the first lookup field and then tries to > dropdown the second lookup, Delphi somehow tries to do a lookup on the > lookup table of the _second_ lookup field with the value of the first > lookup > field, which of course excepts being of different types. > > However, if the user first selects from the second lookup and then drops > down the first lookup field everything works just fine. > > Lookups as such are working. Both lists show the correct values. There is > just some kind of cross reference when having selected a value from the > first lookup. Not sure what could be causing this, though I have heard of other cases where there was a problem having more than one lookup field in a DBGrid. Searching in QC I find #8800 is definitely related to this, perhaps you could add your own reproducible steps to this report. In general, I avoid editing in DBGrids, preferring to provide separate data entry forms for most things. Where using a grid for entry really makes sense I tend to use string grids or other controls which give me better control over behaviour. -- Wayne Niddery - Winwright, Inc. (www.winwright.ca)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads