445,704 Members | 1,867 Online
Need help? Post your question and get tips & solutions from a community of 445,704 IT Pros & Developers. It's quick & easy.

# How to bring the particular data to next entry

 100+ P: 140 Hi all, form name:accounts 5 txt fields are amt1 + amt2 = grandtotal. cashgiven by someone is (credit) grandtotal - credit = cash in hand i want this cash in hand field data to be displayed in the next form also. so that i can able to know how much i ve cash is remaining. Private Sub amt1_AfterUpdate() [GrandTotal] = Abs([Amt1]) + Abs([Amt2]) End Sub Private Sub amt2_AfterUpdate() [GrandTotal] = Abs([Amt1]) + Abs([Amt2]) End Sub Private Sub GrandTotal_AfterUpdate() cashinhand = Abs([GrandTotal]) - Abs([credit]) End Sub Private Sub credit_AfterUpdate() cashinhand = Abs([GrandTotal]) - Abs([credit]) End Sub by giving this script. its calculating the amount but not showing the amount in my next entry. how to do this. help me out Nov 30 '06 #1
6 Replies

 Expert 2.5K+ P: 3,072 Try to add a refresh after the calculation like: cashinhand = Abs([GrandTotal]) - Abs([credit]) me.refresh Nic;o) Nov 30 '06 #2

 100+ P: 140 Try to add a refresh after the calculation like: cashinhand = Abs([GrandTotal]) - Abs([credit]) me.refresh Nic;o) hi nic its not working,:( . am handling a petty cash... see am entering credit (\$500) till it gets over it has to show the cash in hand field. whenever i enter amt1 and amt2 it should automatically deducts from credit. let me be clearly explain you. amt1 n amt2 are added in grandtotal credit is i get from my senior authority. i use this amt still it get over. where cash in hand is subtraction of credit and grandtotal. this one should be displayed in next entry also. so that i know how much i ve with me. give me suggestion to handle in any other way. pls yeah Nov 30 '06 #3

 100+ P: 140 Hi all, what yeah no replies.:( Dec 4 '06 #4

 Expert 2.5K+ P: 3,072 Sorry, lost track of thisone. Can you upload the not working part of the .mdb and post the link here so I can have a look. Nic;o) Dec 4 '06 #5

 100+ P: 140 hi, how to upload. there is no button or icon for attachments and upload. Private Sub amt1_AfterUpdate() [GrandTotal] = Abs([Amt1]) + Abs([Amt2]) End Sub Private Sub amt2_AfterUpdate() [GrandTotal] = Abs([Amt1]) + Abs([Amt2]) End Sub Private Sub grandTotal_AfterUpdate() 'subtraction of grandtotal and credit to get the cash in hand cashinhand = Abs([GrandTotal]) - Abs([credit]) Me.Refresh End Sub Private Sub credit_AfterUpdate() 'subtraction of grandtotal and credit to get the cash in hand cashinhand = Abs([GrandTotal]) - Abs([credit]) Me.Refresh End Sub once i click save button all the datas are saved. i want cash in hand to remain there. to calculate the next entry. Dec 5 '06 #6

 Expert 2.5K+ P: 3,072 Normally we use an unbound field with as controlsource: =Abs([GrandTotal]) - Abs([credit]) to display values from a recordset subtracted. When you need the same info on another form you can use the unique key on that form to execute the same calculation in a query and show the result there with a: =DLOOKUP("outcome","qryCalculate","OderitemID=" & [OrderitemID) Finally you can store that value in a public variable in a module and create a function to get the value available when and where needed. Nic;o) Dec 5 '06 #7