Option for Taxable Quote

G

Guest

I have a form I created for a quotes it's pretty basic...I want to be able to
add a section on my form that allows the user to select Yes/No if the quote
is taxable...and if they select YES it gives them the option of inputting the
tax % and the result is outputted...

Any help would be great!!!
By the Way, I'm a beginner so go easy... :)
 
C

Carl Rapson

Crystal T said:
I have a form I created for a quotes it's pretty basic...I want to be able
to
add a section on my form that allows the user to select Yes/No if the
quote
is taxable...and if they select YES it gives them the option of inputting
the
tax % and the result is outputted...

Any help would be great!!!
By the Way, I'm a beginner so go easy... :)

You don't say if your form is based on a table or tables. Also, some
information about the structure of a quote would be helpful. Does your quote
contain line items that are summed to produce the quote total? Under normal
circumstances, a quote contains header information (quote number, date,
customer, etc.) and line items (item number, quantity, unit price). The
tables storing this information are in a one-to-many relationship (many line
items for one quote), joined on the quote number. If your quote doesn't
contain line items, it could be stored all in one table.

Add the following items to your form: a checkbox control (chkTaxable), a
textbox control (txtTaxRate), and another textbox control (txtTotalWithTax).
You don't say if you will want to store the tax rate along with the quote,
but if you do, you'll also want to add two fields to your underlying table:
a Yes/No field (bound to the chkTaxable checkbox control) and a Number field
(bound to the txtTaxRate textbox control). You don't need to store the quote
total amount, because that can be calculated at any time in a query. Set the
controls' properties so that the Default Value for the checkbox is False
(not taxable) and the two textbox controls are disabled (Enabled = False).

In the Click event of the checkbox control, first see if the checkbox value
is False (not checked); if so, disable the textbox controls. If the checkbox
is True (checked), enable the textbox controls and do the tax calculation:

If Me.chkTaxable Then
Me.txtTaxRate.Enabled = True
Me.txtTotalWithTax = True
Me.txtTotalWithTax = Me.QuoteTotal + (Me.txtTaxRate * Me.QuoteTotal)
Else
Me.txtTotalWithTax = ""
Me.txtTaxRate.Enabled = False
Me.txtTotalWithTax = False
End If

This assumes that the quote amount is stored in a field on your form. If you
have the quote-line items design described above, it's a little more
involved since you first have to fetch the quote amount from the line items
table before doing the calculation:

qTotal = DSum("[Quantity]*[UnitPrice]","[tblLineItems]","[QuoteID]=" &
Me.QuoteID)
Me.txtTotalWithTax = qTotal + (Me.txtTaxRate * qTotal)

Hopefully, this will give you some ideas of how to proceed. I haven't given
a lot of details, but part of the fun of this kind of thing is learning as
you go rather than having someone do everything for you. You can post back
to these newsgroups with specific questions about the different aspects of
this process (such as writing VBA code for control events and setting up
one-to-many relationships).

Good luck,

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top