Update with Data Macro

ZEEq

Member
Local time
Today, 07:33
Joined
Sep 26, 2022
Messages
93
Hello Everyone
I have a question regarding Data Macro i want to change a field value in another table if PK exist i did something like this its working but need your opinion to improve the code
Screenshot (6).png
 
I wonder if you really need the field you're updating. If you can deduce the value from other values or conditions, then we are dealing with a derivable data and that should not be stored. This makes the code superfluous.
 
I wonder if you really need the field you're updating. If you can deduce the value from other values or conditions, then we are dealing with a derivable data and that should not be stored. This makes the code superfluous.
thanks for your reply can you explain your point in details please
 
Perhaps you should first explain a bit more about the purpose of your database and the meaning of the fields. Then maybe I can explain more precisely what I mean.
 
Perhaps you should first explain a bit more about the purpose of your database and the meaning of the fields. Then maybe I can explain more precisely what I mean.
this is student Fee Management Database that i have been working on
1.StudentFeeDueT ( this table contain monthly Invoices of students and it has additional discount field)
2.studentAdditionalDiscountT (this table contains Discounts related with that student )
if StudentFeeDueT contain that Discount ID i want the flag to show this discount cannot be applied again
 
Last edited:
So that's exactly what I mean. If you can deduce the value of the flag from the presence of a discount ID in a certain table, then that flag is superfluous. If you want to know somewhere in a process whether the discount can still be applied, you only have to check the ID. The danger of your construction is that inconsistencies can arise. So that the flag indicates something different than appears from the filling of the tables.
 
So that's exactly what I mean. If you can deduce the value of the flag from the presence of a discount ID in a certain table, then that flag is superfluous. If you want to know somewhere in a process whether the discount can still be applied, you only have to check the ID. The danger of your construction is that inconsistencies can arise. So that the flag indicates something different than appears from the filling of the tables.
that means i need to make some changes to my database design
i will start new topic regarding design
thanks @XPS35
 
I agree with Peter. I would also suggest you review your data model (tables and relationships) with some test data to ensure your set up accurately reflects your "business" and needs. See stump the model for more info.

You may also get some insight on data macros from this and the dialog in the thread.
 

Users who are viewing this thread

Back
Top Bottom