Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-29-2019, 07:49 PM   #1
access2010
Newly Registered User
 
Join Date: Dec 2009
Posts: 484
Thanks: 287
Thanked 0 Times in 0 Posts
access2010 is on a distinguished road
Calculation assistance

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
Attached Files
File Type: mdb Calculation_And_Copy.mdb (644.0 KB, 13 views)

access2010 is offline   Reply With Quote
Old 05-05-2019, 04:35 AM   #2
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,306
Thanks: 534
Thanked 935 Times in 886 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Calculation assistance

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.
__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
The Following User Says Thank You to Uncle Gizmo For This Useful Post:
access2010 (05-13-2019)
Old 05-05-2019, 06:07 AM   #3
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,298
Thanks: 430
Thanked 782 Times in 759 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: Calculation assistance

They do not Tony, they merely ask here.

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
access2010 (05-13-2019)
Old 05-05-2019, 09:04 PM   #4
access2010
Newly Registered User
 
Join Date: Dec 2009
Posts: 484
Thanks: 287
Thanked 0 Times in 0 Posts
access2010 is on a distinguished road
Re: Calculation assistance

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 Uncle Gizmo; 05-06-2019 at 04:34 AM. Reason: added code tags
access2010 is offline   Reply With Quote
Old 05-06-2019, 03:44 AM   #5
gemma-the-husky
Super Moderator
 
gemma-the-husky's Avatar
 
Join Date: Sep 2006
Location: UK
Posts: 13,791
Thanks: 55
Thanked 1,026 Times in 992 Posts
gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all
Re: Calculation assistance

@OP
Quote:
(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.



Quote:
(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?
__________________
Dave (Male!)
Gemma was my dog

if a poster helps you, please click the scales at the bottom left of this posting, or use the thanks button alongside.

Last edited by gemma-the-husky; 05-06-2019 at 03:49 AM.
gemma-the-husky is offline   Reply With Quote
The Following User Says Thank You to gemma-the-husky For This Useful Post:
access2010 (05-13-2019)
Old 05-13-2019, 09:07 AM   #6
access2010
Newly Registered User
 
Join Date: Dec 2009
Posts: 484
Thanks: 287
Thanked 0 Times in 0 Posts
access2010 is on a distinguished road
Re: Calculation assistance

gemma-the-husky
Thank you, your suggestion works.

Crystal

access2010 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Assistance needed in getting the right calculation Voyager Modules & VBA 5 01-11-2019 09:13 AM
Need assistance finding code error CALCULATION #Error newbie4access Forms 13 06-21-2015 09:13 AM
[SOLVED] Need Assistance Again wind20mph Forms 6 04-03-2014 12:58 AM
Form Calculation Assistance chrisguk General 1 08-18-2011 03:42 AM
Report Calculation Assistance Jakboi Reports 9 01-18-2007 12:04 PM




All times are GMT -8. The time now is 03:18 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World