Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Not charging Sales Tax if Customer has Resale Number ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mthornblad@gmail.com - 15 Jul 2007 03:45 GMT
Hi

I have a Master/Detail (form/subform) for Customer Invoices.  The
Master portion of the form contains the Customer info. Customer
number, customer name, resale number, and invoice number.  Some
customers have a resale number and some don't.

The Detail portion of the form contains the line items for the
invoice.  One of the fields in each line items is sales tax.

If the customer has a resale number, then they are not charged sales
tax.  If the customer does not have a resale number, they are charged
the current sales tax rate.

How can I handle this situation ?  I would appreciate any help.

Thanks in advance

Mark
John W. Vinson - 15 Jul 2007 06:11 GMT
>Hi
>
[quoted text clipped - 15 lines]
>
>Mark

How are you calculating the tax now?

You could use an expression in a calculated control on the subform:

[ItemPrice] * (1 + IIF(IsNull(Parent![ResaleNumber]), [TaxRate], 0)

            John W. Vinson [MVP]
mthornblad@gmail.com - 15 Jul 2007 08:04 GMT
On Jul 15, 12:11 am, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> >Hi
>
[quoted text clipped - 23 lines]
>
>              John W. Vinson [MVP]

Thanks John

When you say "calculated control" on the subform, I hope you mean the
Tax control.  Your 1 line solution is exactly what I was looking for.
I will give this bit of code a go and hopefully I will get it right.
Thanks again....

Mark
Allen Browne - 15 Jul 2007 06:42 GMT
Use the BeforeInsert event procedure of the subform to look up the
customer's [Resale Number] and assign the TaxRate accordingly.

Ideally the line items table has a TaxRate field, not a TaxAmount field.
This avoids the dependency between the fields (always good design.)

Form_BeforeInsert fires only when creating a new record. Using this event
prevents the problems that could occur with editing old records after a
customer acquired (or lost) their tax free status.

The lookup could look in a hidden column of the CustomerID combo on the main
form. Alternatively, it could use DLookup() to examine the record in the
Customer table. For help with DLookup() see:
   Getting a value from a table: DLookup()
at:
   http://allenbrowne.com/casu-07.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I have a Master/Detail (form/subform) for Customer Invoices.  The
> Master portion of the form contains the Customer info. Customer
[quoted text clipped - 13 lines]
>
> Mark
mthornblad@gmail.com - 15 Jul 2007 07:51 GMT
On Jul 15, 12:42 am, "Allen Browne" <AllenBro...@SeeSig.Invalid>
wrote:
> Use the BeforeInsert event procedure of the subform to look up the
> customer's [Resale Number] and assign the TaxRate accordingly.
[quoted text clipped - 39 lines]
>
> > Mark

Allen.. Thanks ..  I have the current tax rate hidden on the subform.
I will store the tax rate as opposed to the tax amount in the
underlying table as you suggest.  As far as future updating of these
records, I have the Data Entry property set to Yes so users can only
enter new data.  John's suggestion is basically what I was looking
for.  I am going to try it and hopefully it will work.

This is my first project with Access.  I have many years of
programming experience with Cobol.  But Access is creating a bit of a
learning curve.  But I am learning SQL and Access and am really
enjoying the challenge.  The more I learn the more I like it.

I will have many more questions as I develop the system I am working
on and look forward to your help in the future.

Your expertise is greatly appreciated ...

Mark
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.