So, I duplicated Stocks (creating STocks2) and related it to itself via stockID.pk in each table.
Edit the relationship between Stocks and Stocks2 and use the relational operator '≠' or 'x' instead of '='
Changing the relationship to '≠' or 'x' instead of '=' shows all the stocks in a portal BUT,
there is no ability to "Add" new stocks.
The "allow new records to be added..." is disabled. How can I get around this problem?
Thanks for your reply.... I had never seen how/why I should use '≠' or 'x'.
'≠' and 'x' are different. Obviously '≠' means not equal, but 'x' means 'any'. What I have done before is setup a Main table, with 1 record, 1 field, with the value 1. Relate it to other tables, with a calculation field in those tables, =1. Create the layout based on the Main table, and the portal will show all the records, and you'll be able to create records in the portal table.
You say ... setup a Main table, with 1 record, 1 field, with the value 1. Relate it to other tables, with a calculation field in those tables, =1. Create the layout based on the Main table
To clarify, are you saying I should create a new table called MAIN with one field called 'field1' and that I should add 'field1' to both TO of STOCKS and STOCKS2. Field1 should be a calculated field =1 and that both STOCK and STOCK2 should be related to MAIN through field1?
Whew. Do I have this right?
(It will be a while before I can get back to my work computer so I thought I would go for clarification now)
Yep, except it doesn't look like you need the Stocks2 table.
I set up a table name StockPortal with a single field1 = calculated value of 1
I added Field1 also calculated to STOCKS.
I set a relationship of StockPortal into STocks based via Field1 in each table.
I based the portal ono StockPortal.
The portal is empty and shows only the stock::symbol and stock::name of the current record.... huh?
Since the portal is on a TAB that is in a layout based on STOCKS shouldn't what I have done work?
Make the layout based on the Main table, and the portal based on the Stock table.
Here is an explanatory URL: http://ronaldogordono.googlepages.com/vlpix
The tab object has OPTION TRADES, STOCK TRADES AND ADD OPTIONS as existing tabs.
The layout for these tabs requires a layout based on STOCKS. If I change the layout to
MAIN, the above tabs fail.
It seems there should be a way to get a portal into a table that is the table upon which the layout is based???
Try this instead: Relate Stock back to itself based on 'field1'. Use that self-related table for your portal instead of 'StockPortal'. Then you can remove StockPortal
Hmmm... That idea just resulted in a portal full of the CURRENT stock; instead of showing all the different stocks in the stocks table.
Would you like me to email you the application?
Not if the relation was just by 'field1', that contains the value 1. In fact, every record in Stocks would be related to every other record in Stocks. If you post it on a webserver somewhere, I'll take a look - but, try the self relationship first.
Aha! You have the wrong fields selected in the portal. I should have noticed that before. Select the appropriate fields from 'Stocks 2', and it'll work.
Seemed to work like a charm. But, I added a graphic "X" to the portal row and specified that it should 'delete the portal row'
To my surprise I get "Do you want to delete the Entire Master Record or just his one related record."
When I choose Master record ALL records in the portal are deleted. ugh.... glad I am just testing this app.
I have checked and unchecked "Delete related records in this table when records are deleted in the other table" in the relationship
without apparent affect or consequence.
My other portals (which are NOT self join) have the same portal row delete and it works great.
Waz up with this one?
ANSWER:" Check the box 'perform without dialog' when setting up the button....
Thank you very much for your help and thoughts.