Jump to content

This topic is 8177 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Okay, it seems simple enough, but I give up. How does one define the following fields and get them to play together nicely.

The fields are:

Gross price = Net * 1.15

Net price = Gross * .85

Sometimes Gross price will be entered first into the database and sometimes Net price. How do I get them to behave and not tell me I'm attempting to make a circular definition? I've fumbled long enough with the "If" function to know that I don't know enough. Can someone please help me, immediately if not sooner.

:crazy:

Posted

The secret is that you need four fields:

GrossPriceEntry (number)

NetPriceEntery (number)

cGrossPrice (calculation, number) = If(notIsEmpty(GrosstPriceEntry), GrossPriceEntry, Round(NetPriceEntry*1.15, 2))

cNetPrice (calculation, number) = If(notIsEmpty(NetPriceEntry), NetPriceEntry, Round(GrossPriceEntry*0.85, 2))

On your layout in Layout Mode, using Format --> Field Format, uncheck the "allow entry" option for cGrossPrice and cNetPrice. Also in Layout Mode, format cGrossPrice and cNetPrice as opaque, stack cNetPrice on top of NetPriceEntry and stack cGrossPrice on top of GrossPriceEntry.

How it works: If you click on the net price "stack" of fields you will go to the lower field (NetPriceEntry). The same thing works for the gross price "stack". This allow either entry or calculation for one of both fields.

-bd

  • Newbies
Posted

thanks for the rapid reply. Your help is truly appreciated. For an even more elegant solution, check out the second reply to my query from LiveOak (administrator)

Many thanks for taking the time to respond!

This topic is 8177 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.