John thomas
Registered User.
- Local time
- Today, 13:59
- Joined
- Sep 4, 2012
- Messages
- 206
Help with code please
I have a Products form and a Vat form
When I enter a product in the products Form I also Have fields for calculating the vat and profit
I used to do this with simple code eg Vat=Sell at price /6 and all worked fine
Now I want to use a combo box so that I can offer different rates of vat
My problem is that I cannot get the result from the combo box to alter the rates of tax applied
I am unable to select the Id with the appropriate tax info
Please view the code
I know the problem is something to do with the last bit of code that I have underlined
Private Sub sell_at_price_AfterUpdate()
Me.vat = [sell at price] / Forms!VatRateF!VatSum!IDVatRateTB = "&VatSumID"!
Profit = [sell at price] - [Buy in price] – vat
End Sub
VatRateF is the vat Form . VatSum is The field containing the number to be used in the calculation eg6.
IDVatRateTB Is the ID for vat rates on the vat rate form
VatsumID is the FK from the vat form Table that has the result of the combo stoired into and is on my products form
And also does the vat rate form have to be open for access to take info from it
I hope that all makes sence I am new to vba
Many thanks John
I have a Products form and a Vat form
When I enter a product in the products Form I also Have fields for calculating the vat and profit
I used to do this with simple code eg Vat=Sell at price /6 and all worked fine
Now I want to use a combo box so that I can offer different rates of vat
My problem is that I cannot get the result from the combo box to alter the rates of tax applied
I am unable to select the Id with the appropriate tax info
Please view the code
I know the problem is something to do with the last bit of code that I have underlined
Private Sub sell_at_price_AfterUpdate()
Me.vat = [sell at price] / Forms!VatRateF!VatSum!IDVatRateTB = "&VatSumID"!
Profit = [sell at price] - [Buy in price] – vat
End Sub
VatRateF is the vat Form . VatSum is The field containing the number to be used in the calculation eg6.
IDVatRateTB Is the ID for vat rates on the vat rate form
VatsumID is the FK from the vat form Table that has the result of the combo stoired into and is on my products form
And also does the vat rate form have to be open for access to take info from it
I hope that all makes sence I am new to vba
Many thanks John