Calculation assistance (1 Viewer)

access2010

Registered User.
Local time
Today, 02:48
Joined
Dec 26, 2009
Messages
1,021
Hello, can I please have assistance, with the following calculations?

===
(Average Share Cost)
We would like to copy the Average Share Cost from the SubForm to the Main Form’s field, Net Share Cost

===
(Transactions Profit or Loss)
We would like to find out if this stock was profitable or a loss occurred.
If the Sold $ is greater than the (Drip$ plus Bought$) amount a profit was made and the amount will be Positive.
If the Sold $ is less than the (Drip$ plus Bought$) amount a loss occurred and the amount will be negative

===
Your assistance will be appreciated.
Crystal
 

Attachments

  • Calculation_And_Copy.mdb
    644 KB · Views: 97

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:48
Joined
Jul 9, 2003
Messages
16,278
I note your question has yet to receive a Reply.

Looking at your question my first thought is it might be because it appears you are asking for a ready-made answer, and not demonstrating that you are working on the problem yourself. To correct this issue please post what you have done so far, what you have tried and what is not working.

You are more likely to get help if you show that you are making some effort yourself.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:48
Joined
Sep 21, 2011
Messages
14,254
They do not Tony, they merely ask here.
 

access2010

Registered User.
Local time
Today, 02:48
Joined
Dec 26, 2009
Messages
1,021
Uncle Gizmo, thank you for your note and we will start using the code below to, copy the information from the SubForm to the Main Form
===

Code:
Private Sub Replicator_B_Click()
    If Not Me.NewRecord Then
        Me.Net_Share_Quantity = Me.SubSharesOwned
'        Into                 =  From
'       Above copies the FROM {SubSharesOwned} INTO {Net_Share_Quantity}
        Me.Net_Share_Cost = Me.SubAverageShareCost
'        Into             =  From
'       Above copies the FROM {SubAverageShareCost} INTO {Net_Share_Cost}
        If Not IsNull(Me.Symbol_Stock) Then
        End If
    Else
        MsgBox "Can not perform this function, we are at a New Record"
    End If
 DoCmd.Close acForm, Me.Name
 ' Close Form
End Sub
===
Nicole
 
Last edited by a moderator:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:48
Joined
Sep 12, 2006
Messages
15,650
@OP
(Average Share Cost)
We would like to copy the Average Share Cost from the SubForm to the Main Form’s field, Net Share Cost

I weould have thought this was meaningless on it's own. Why can't you work this out on the subform. If you must show it on the main form, have an unbound control, work the value out on the subform, and just have the control source =[subformname][controlname. You will probably need a bit of trial and error to get the precise syntax.



(Transactions Profit or Loss)
We would like to find out if this stock was profitable or a loss occurred.
If the Sold $ is greater than the (Drip$ plus Bought$) amount a profit was made and the amount will be Positive.
If the Sold $ is less than the (Drip$ plus Bought$) amount a loss occurred and the amount will be negative

if you are finding this hard to do, then your data structure might need attention. Why are you finding it hard to get at this value? How do you evaluate the profit/loss on a partial sale of a stock. do you store each purchase transaction separately, and then sell particular batches? or do you aggregate the total purchases and then sell using an average cost of the stockholding? Do you have to have both methods available?
 
Last edited:

access2010

Registered User.
Local time
Today, 02:48
Joined
Dec 26, 2009
Messages
1,021
gemma-the-husky
Thank you, your suggestion works.

Crystal
 

Users who are viewing this thread

Top Bottom