Re: Unable to implement list box from related table in table list view




Basically, all I want is the ability to implement a list box column in the
main table to be populated with values from a two -column pick table (one
integer primary key column and one text column).  I would like the column
type in the main table to be an integer but display the text from a text
column in the pick table.  Of course the list box column in the main table
will offer all of the choices from all of the rows in the text column of the
pick table when activated (clicked, ...).

I would like to achieve this in the list view of the table as that will
accomplish all of my basic data entry needs.

Do you have a little two-table example database that has nothing but the
required relationship and a couple rows of example data in each table.  I
searched all of your canned examples and didn't find a demonstration of
this.  I can get everything set up so it looks like it works perfectly but
when I make the actual selection, I get an error.

Once I get this, I can shut down MS Access and Windows just so you know how
badly I want it.


Murray Cumming wrote:

On Sun, 2009-06-14 at 19:00 -0700, BrownsLink wrote:
I have a table called Packages with a field called Rating.  I have
another
table called PackageRatings with field called PackageRating and a
field
called Identifier.  From the Packages list view, I defined a
relationship.
http://www.nabble.com/file/p24027800/snapshot1.png 
When I added the field to the table list view, I used the
relationship.
http://www.nabble.com/file/p24027800/snapshot2.png 

That relationship doesn't seem to be the same one that you mentioend in
snapshot1.png. It seems to be from the other table, in the other
direction.

But anyway, that's showing a field from another table, not the current
table. I guess you want to allow the user to choose an ID in the current
table, so that other information will be visible from the other table.

I selected the Choices tab to implement the list box.
http://www.nabble.com/file/p24027800/snapshot3.png 
Everything looks great.  The table list view shows the right values.
The
list box offers the right choices but when I select one of the choices
to
specify the value for the field I get Internal Error - ERROR:
duplicate key
value violates unique constraint "PackageRatings_pkey"
http://www.nabble.com/file/p24027800/snapshot4.png

I think this is editing a record in the related table. But I think you
want to just choose a value from the related table, to enter into a
field in the current table.

I can see a few things that could provide useful hints:
- That error message should be much nicer.
- We should warn when you specify Choices based on all the current
values for the field itself, if the field should have unique values
(such as a primary key field).
 
Am I doing everything correctly?  I will be happy to file a bug and
provide
my entire database if needed.
-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com

_______________________________________________
glom-devel-list mailing list
glom-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/glom-devel-list



-- 
View this message in context: 
http://www.nabble.com/Unable-to-implement-list-box-from-related-table-in-table-list-view-tp24027800p24053351.html
Sent from the Gnome - Glom - Dev mailing list archive at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]