Page 1 of 1

referencing field on the same form

Posted: Tue Jan 03, 2017 7:16 am
by brumsumsel
Hi,
i think it's a trivial question but i didn't find a solution (maybe of my worst english).
I try to create a small accounting app. In the form is one dropdown field with the accounting type (income, expense) and another dropdown field with the account. The database table for the accounts contain both, income and expense accounts. In the field for the accounts i only want to display the accounts which match the formfield acc_type. How can i reference the accounting type field in my SQL for the account field?
select account_id, account_desc from tbl_account where account_type = ????
Is there a easy solution for this?

Thanks
Thomas

Re: referencing field on the same form

Posted: Wed Jan 04, 2017 1:46 pm
by brumsumsel
OK, i found a solution. As expected it wasn't difficult.
select account_id, account_desc from tbl_account where account_type = '#acc_type#'
is correct. But it is nessaccary to save the form after editing the acc_type field. By adding a event on this field the form is saved and the query in the account field deliver the correct result.
Eventname: onchange
Javascript: nuSaveForm()

Re: referencing field on the same form

Posted: Tue Jan 24, 2017 3:29 am
by admin
well done!