[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


checkbox to switch between discount and no discount on form

Posted on 2004-10-22
Medium Priority
Last Modified: 2012-05-05
I am very very new to access and have bludgeoned my way through making an invoiceing system for our workshop but cannot work out how to do this last bit which I assume would be in vb in the way of an IF statement.
On the form there are 5 text boxes:

Total (Ex-Tax): =OrdersSF.Form!txtTotal
              GST:  =[txtTotal]*0.1
   Order Total:  =[txtSalesTax]+[txtTotal]
Discount 10%:
 Invoice Total:  =[txtOrderTotal]-[txtDiscount]

On the form beside the Discount 10% entry is a checkbox and I would like it to display a 10% discount from the order total when checked and retotal the amount to the Invoice total, and when unchecked put a 0 discount in the discount and display the order total in the invoice total without the discount removed.
As I said I am not really sure as to what needs to be done be it a new query or code but any help would be great.
I hope I have explained what I need well enough to get some help on this.

The Pro

Question by:The_Professional
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Bat17 earned 1000 total points
ID: 12382192
create you checkbox called chkDiscount and set its default value to False, create your txtDiscount and set it default value to 0
on the event for the checkboxs add this code:-

Private Sub chkDiscount_Click()
Dim curTax As Currency
Dim curTotal As Currency
If Me.chkDiscount = True Then
    curTax = Me.txtSalesTax
    curTotal = Me.txtTotal
    Me.txtDiscount = (curTax + curTotal) * 0.1
    Me.txtDiscount = 0
End If
End Sub



Author Comment

ID: 12390385
Thanx Peter worked perfectly your help is much appreciated.

The Pro

Expert Comment

ID: 12391873
Thanks for the Grade and points :-)

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question