>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
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