Subject LookupCombo On Grid + JOIN
Author James N Hitz

I am new to this newsgroup and to IBObjects. I have been struggling with LookpCombo on a grid, but after searching the NG archives, I finally got it to work.

I am now trying to move a step further so that that the combo can display a non-primary key. Here is what I mean:

I have two tables:

Contacts (CID, CTITLE, FNAME, LNAME, SEX, EMAIL ... CATID) as qryCont
Categories (CATID, CATNAME) as qryCat

If I use CATID for the KeyLinks and set KeySource to qryCat, then drop the combo on a grid, it works like clock-work... this however means that the grid displays CATID and CATNAME is only visible when the combo is dropped-down.

A previous post sighted that the DisplayField must also be included in both sides of the KeyLink/Lookup, so I tried to set qryCont to:

SELECT contacts.*, categories.catname
FROM contacts
LEFT JOIN categories ON contacts.catid = categories.catid

The dataset comes as readonly and I think this is where the problem lies so that even when I change the DisplayField of the LookupCombo it still fails.

I know the field catname in the dataset is a "virtual" field but is it possible to allow "virtual" changes in catname to propage to catid? I've seen behaviour like that somewhere... just wondering. Any ideas?



[Non-text portions of this message have been removed]