Hi guys
I have a table that contains a list of Parts in a stock and inventory type of database.
It has field called "[Markup]" that contains the percentage markup and is calculated and updated each time the database is start via a query. The [Markup] field is defined as a Percentage field type. All of this works well.
The following is the query that updates the [Markup] field:
([UnitPrice]-([Wholesale]))/[Wholesale])
I have a form that displays the records in the Parts table in Datasheet view and want to calculate a new "UnitPrice" because the Wholesale price ([Wholesale]) has changed and I want to maintain the same Markup percentage.
I have spent hours trying to work out a VBA formula that I can use via the form but just can't get it!
For example, if the new Wholesale is $9.88 and the Markup percentage is 26.56% then the following formula on a calculator works fine:
9.88 + 26.56% = 12.50
I thought I could simply do the following in VBA:
Me.txtUnitPrice = Me.Wholesale * Me.Markup
but the result is $2.62
What am I doing wrong???
Thanks for any help you can provide.
Cheers
Greg
I have a table that contains a list of Parts in a stock and inventory type of database.
It has field called "[Markup]" that contains the percentage markup and is calculated and updated each time the database is start via a query. The [Markup] field is defined as a Percentage field type. All of this works well.
The following is the query that updates the [Markup] field:
([UnitPrice]-([Wholesale]))/[Wholesale])
I have a form that displays the records in the Parts table in Datasheet view and want to calculate a new "UnitPrice" because the Wholesale price ([Wholesale]) has changed and I want to maintain the same Markup percentage.
I have spent hours trying to work out a VBA formula that I can use via the form but just can't get it!
For example, if the new Wholesale is $9.88 and the Markup percentage is 26.56% then the following formula on a calculator works fine:
9.88 + 26.56% = 12.50
I thought I could simply do the following in VBA:
Me.txtUnitPrice = Me.Wholesale * Me.Markup
but the result is $2.62
What am I doing wrong???
Thanks for any help you can provide.
Cheers
Greg
Last edited: