Results 1 to 9 of 9
  1. #1
    ShadeRF is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    24

    Query Formulas

    In my database now I currently have a user input a Retail Price then run a query which calculates all of the following:



    Retail : Entered Manual
    SellTo: Format(Nz(([Retail])*([PackSize]))/1.3,"Currency")
    TotalCostImporter: Nz([FOBImporter]+Nz([TaxDuty])+Nz([OceanFreight])+Nz([CBFees])+Nz([InlandFreight])+Nz([MarineInsurance]))
    LICDistributor: Nz([FOBDistributor])+Nz([Freight])+Nz([TotalTax])
    WISNetProfit: Nz([FOBDistributor])-Nz([TotalCostImporter])
    DistMargin: Nz([SellTo])-Nz([LICDistributor])
    MarginPerc: Nz([DistMargin])/Nz([LICDistributor])

    However I'd also like to do the reverse and allow them to enter the
    DistMargin or MarginPerc and it basically reverse calculate all the fields including the retail which I previously entered manually. How can I do this?

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Do you want to show three fields and whichever one gets an entry

    will calculate the others and update the record?
    If so, how about using the afterupdate event to run the VBA to do the calcs and post to the other fields?

  3. #3
    ShadeRF is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    24
    My issue is more so how to change the formulas so it works

  4. #4
    ShadeRF is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    24
    Anyone have any input?

  5. #5
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    You will have to repost and show what fields are known from

    other sources. I don't want to try to figure it out when I'd be guessing at which fields have values and which are unknown. I understand that Retail, Marginperc, and DistMargin are unknown, as is LicDistributor. Are all of the other fields known?

  6. #6
    ShadeRF is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    24
    Right now only retail is unknown. I key in the retail and all the formula's listed process. What I want to do is have one where only the DistMargin is the unknown and process the others based on this. And then do the same seperately for Margin% being the unknown.

  7. #7
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481
    Case Retail:
    Retail : Entered Manual
    SellTo: Format(Nz(([Retail])*([PackSize]))/1.3,"Currency")
    TotalCostImporter: Nz([FOBImporter]+Nz([TaxDuty])+Nz([OceanFreight])+Nz([CBFees])+Nz([InlandFreight])+Nz([MarineInsurance]))
    LICDistributor: Nz([FOBDistributor])+Nz([Freight])+Nz([TotalTax])
    WISNetProfit: Nz([FOBDistributor])-Nz([TotalCostImporter])
    DistMargin: Nz([SellTo])-Nz([LICDistributor])
    MarginPerc: Nz([DistMargin])/Nz([LICDistributor])

    Case MarginPerc
    MarginPerc: Entered Manual
    TotalCostImporter: Nz([FOBImporter]+Nz([TaxDuty])+Nz([OceanFreight])+Nz([CBFees])+Nz([InlandFreight])+Nz([MarineInsurance]))
    LICDistributor: Nz([FOBDistributor])+Nz([Freight])+Nz([TotalTax])
    WISNetProfit: Nz([FOBDistributor])-Nz([TotalCostImporter])
    DistMargin: MarginPerc*NZ([LICDistributor])
    SellTo: DistMargin+Nz([LICDistributor])
    Retail: SellTo*1.3/[Packsize]

    See if MarginPerc works. If it does, I'll do the other one. Note: You may need to reinsert NZ in the equations to stop some errors.

  8. #8
    ShadeRF is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    24
    I got this in and it appears to be working beautifully! Thank you very much. I'd love the other one if you can do it. Thanks again!

  9. #9
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Good. Here's DistMargin

    [QUOTE=hertfordkc;93307]Case Retail:
    Retail : Entered Manual
    SellTo: Format(Nz(([Retail])*([PackSize]))/1.3,"Currency")
    TotalCostImporter: Nz([FOBImporter]+Nz([TaxDuty])+Nz([OceanFreight])+Nz([CBFees])+Nz([InlandFreight])+Nz([MarineInsurance]))
    LICDistributor: Nz([FOBDistributor])+Nz([Freight])+Nz([TotalTax])
    WISNetProfit: Nz([FOBDistributor])-Nz([TotalCostImporter])
    DistMargin: Nz([SellTo])-Nz([LICDistributor])
    MarginPerc: Nz([DistMargin])/Nz([LICDistributor])

    Case MarginPerc
    MarginPerc: Entered Manual
    TotalCostImporter: Nz([FOBImporter]+Nz([TaxDuty])+Nz([OceanFreight])+Nz([CBFees])+Nz([InlandFreight])+Nz([MarineInsurance]))
    LICDistributor: Nz([FOBDistributor])+Nz([Freight])+Nz([TotalTax])
    WISNetProfit: Nz([FOBDistributor])-Nz([TotalCostImporter])
    DistMargin: MarginPerc*NZ([LICDistributor])
    SellTo: DistMargin+Nz([LICDistributor])
    Retail: SellTo*1.3/[Packsize]

    Case DistMargin
    DistMargin: Entered Manual
    TotalCostImporter: Nz([FOBImporter]+Nz([TaxDuty])+Nz([OceanFreight])+Nz([CBFees])+Nz([InlandFreight])+Nz([MarineInsurance]))
    LICDistributor: Nz([FOBDistributor])+Nz([Freight])+Nz([TotalTax])
    WISNetProfit: Nz([FOBDistributor])-Nz([TotalCostImporter])
    MarginPerc = DistMargin/NZ([LICDistributor])
    SellTo: DistMargin+Nz([LICDistributor])
    Retail: SellTo*1.3/[Packsize]

    Note: You may need to reinsert NZ in the equations to stop some errors.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query Formulas
    By ShadeRF in forum Queries
    Replies: 6
    Last Post: 11-15-2011, 10:45 AM
  2. Formulas
    By dunnmel4 in forum Access
    Replies: 0
    Last Post: 03-27-2011, 04:59 PM
  3. Formatting formulas
    By katrinanyc926 in forum Queries
    Replies: 2
    Last Post: 08-16-2010, 07:52 AM
  4. Replies: 1
    Last Post: 01-22-2008, 03:36 PM
  5. Replies: 0
    Last Post: 03-05-2007, 08:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums