Hi
I’m using Professional version 8.
My partial database structure is as follows:
TableA {Field1 (PK), Field2 (Foreign Key [smallint(5) Data Type] related to Primary Key[smallint(5) Data Type], Field3, Field4}
In scriptcase for field2 we?ve turned SELECT on SQL ? [SELECT FieldA FieldB FROM TableB ORDER BY FieldB]
TableB {FieldA(PK) [smallint(5) Data Type], FieldB]
What I want to achieve is that as soon as I enter an amount in field3, a value is calculated into field 4 as per the following formula:
In Table A I?ve entered a PHP method: {field4} = {field3} / {field2}
I?ve created a new Ajax onchange Event in TableA on selected field3 and 2clicked both field2 and field4 as parameters to be passed.
Then I?ve called the above PHP function as method() in the Ajax method_onChange window.
However when I run the application I get a massive error instead.
I?m very certain that a big part of this error is because I?ve made reference to field2 in the formula which does not contain my required value because it is merely a relation key. I think I should?ve used fieldB instead.
Could anybody help me with guidance on how to use a field from a different table in my formula to correctly achieve my objective? Also, have I made any additional syntactical mistakes (for example should I have used curly brackets {). Likewise did I pass the correct parameters in Ajax to get the correct calculations as above. Please forgive my ignorance but I?m a novice in this (but have much ambiyion to achieve).
Thanking you in anticipation,
John