InterviewSolution
Saved Bookmarks
| 1. |
Solve : Access Functions? |
|
Answer» I have 2 tables So every time i input data in to quantity access should be able to calculate that and leave a value on earning Access quantity how? If through a form, you can use any of the form events to recalculate earning. What happens if price changes? It is not good practice to store calculated fields in a database. Not only do they waste space but keeping them updated becomes a nightmare. ID is a common key in your tables. By using a simple JOIN, you can recalculate earning when retrieving the records with SQL. Hope this gives you some ideas. Sorry for the miss type. What you said is definately true but in my program price change will not effect anything. What really i am trying to do is build an ACCOUNTENT program for a restaurant, i am not using forms on Access but i have a build program on VB.net that is link to Access database. By doing so to get the app to store Earning to database using VB is possible but it is the lack of speed. Because Access has function to do so but my knowledge are not great so i need some help. So SQL, how about i am going to do this? All i need is a somethings like function or Expression Builder to get access to automatically calculate. Table 1 Id/ Name/ Price/ < This table will not be updated or change but if is change it will have no effect on anythings "If price is change, obviously my Earning on 2nd table will be change but that dont matter Table 2 Id/ Quantity/ Earning/ < Only id and Quantity field will be updated frequently Earning is what needed to be automatically change by access I have try something on expression builder like: Validation on cost [cost]=[price]*[quantity] But it didnt work because price was in a different table You may have to make some changes to the SELECT statement, but this little piece of SQL should help you out: Code: [Select]Select Table1.Price*Table2.Quantity From Table1, Table2 Where Table1.id = Table2.id Quote What you said is definately true but in my program price change will not effect anything. How can it not? or is this the creative accounting I hear so much about? Quote How can it not? or is this the creative accounting I hear so much about?Well maby in my planning Anyway alot of thanks and i will try it. BTW i remember some of the members here such as you, like 2 or 3 years back my name used to be T-Chai or Elexir. Those members that was here back then did really had a low RANK but now man, you and others are really helping out lots of people. I guess this Forum still have Wana be helper, And What about GX10 MAN has he quit Well anyway I stop using this forum because i had so much work in my hand mostly VB.NET project. But i will stop by and try to help again. |
|