A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access 2002 Form Sales Tax Field



 
 
Thread Tools Display Modes
  #1  
Old January 1st, 2007, 06:17 AM posted to microsoft.public.access.forms
Rick
external usenet poster
 
Posts: 2
Default Access 2002 Form Sales Tax Field

I need to create a sales tax field on a form that displays calculated tax on
"in state" sales and "0.00" on "out of state sales". If this can be linked to
a text field that contains the "State" abbriviation, ie "CA", "AZ", "AR",
etc., this would be ideal.

  #2  
Old January 1st, 2007, 02:27 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Access 2002 Form Sales Tax Field

Add a textbox to your form for the sales tax. Set the controlsource to:

=IIf([cboState] = "FL", [txtTotal]*0.07, 0.00)

substitute the name of your state control for cboState, your total control
for txtTotal, and the proper state and sales tax.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Rick" wrote in message
...
I need to create a sales tax field on a form that displays calculated tax
on
"in state" sales and "0.00" on "out of state sales". If this can be linked
to
a text field that contains the "State" abbriviation, ie "CA", "AZ", "AR",
etc., this would be ideal.



  #3  
Old January 1st, 2007, 02:55 PM posted to microsoft.public.access.forms
Rick
external usenet poster
 
Posts: 727
Default Access 2002 Form Sales Tax Field

Thanks Alvin. The statement works great. Now, is there a way to get this
information to record to s database?

"Arvin Meyer [MVP]" wrote:

Add a textbox to your form for the sales tax. Set the controlsource to:

=IIf([cboState] = "FL", [txtTotal]*0.07, 0.00)

substitute the name of your state control for cboState, your total control
for txtTotal, and the proper state and sales tax.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Rick" wrote in message
...
I need to create a sales tax field on a form that displays calculated tax
on
"in state" sales and "0.00" on "out of state sales". If this can be linked
to
a text field that contains the "State" abbriviation, ie "CA", "AZ", "AR",
etc., this would be ideal.




  #4  
Old January 1st, 2007, 03:45 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Access 2002 Form Sales Tax Field

Unless you need to keep history of a sales for more than a year, you do not
need to record the tax since it will always be recalculated. If you do need
to store it, use some code in the AfterUpdate event of the state field to
write it to a bound control, instead of a calculated one:

Sub cboState AfterUpdate()
If Me.cboState = "FL" Then
Me.txtTax = 0.07*Me.txtTotal
Else
Me.txtTax = 0
End If
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Rick" wrote in message
...
Thanks Alvin. The statement works great. Now, is there a way to get this
information to record to s database?

"Arvin Meyer [MVP]" wrote:

Add a textbox to your form for the sales tax. Set the controlsource to:

=IIf([cboState] = "FL", [txtTotal]*0.07, 0.00)

substitute the name of your state control for cboState, your total
control
for txtTotal, and the proper state and sales tax.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Rick" wrote in message
...
I need to create a sales tax field on a form that displays calculated
tax
on
"in state" sales and "0.00" on "out of state sales". If this can be
linked
to
a text field that contains the "State" abbriviation, ie "CA", "AZ",
"AR",
etc., this would be ideal.






  #5  
Old January 1st, 2007, 07:11 PM posted to microsoft.public.access.forms
HiTechCoach via AccessMonster.com
external usenet poster
 
Posts: 14
Default Access 2002 Form Sales Tax Field

Ypu really should not store the calculation. You do need to store the tax
rate in the record so that ypu can calculate the total sales tx as needed.



Rick wrote:
Thanks Alvin. The statement works great. Now, is there a way to get this
information to record to s database?

Add a textbox to your form for the sales tax. Set the controlsource to:

[quoted text clipped - 8 lines]
a text field that contains the "State" abbriviation, ie "CA", "AZ", "AR",
etc., this would be ideal.


--
Boyd
Hi Tech Coach
http://www.hitechcoach.com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200701/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.