I'm building a form for entering credit/debit transactions, so I have two tables in PostgreSQL
accounts
id INTEGER PRIMARY KEY
name VARCHAR(128)
ledger
id INTEGER PRIMARY KEY
credit INTEGER NOT NULL REFERENCES accounts
debit INTEGER NOT NULL REFERENCES accounts
date DATE NOT NULL
amount NUMERIC(8,2)
text VARCHAR(128)
I have built a form with a single table control, listing accounts.name, and a subform that references that control for selection.
Inside the subform, there is another table control, showing date
, credit
, text
and amount
after matching debit
against the selected entry in the master.
So far, that works, however the credit
column has the numeric foreign key data inside a numeric field. I'd like to have a dropdown field that allows me to select an account in its place.
Is that possible, or should I go for a fallback solution with a readonly table populated from a query, and separate edit fields in a subsubform?