Results 1 to 10 of 10
  1. #1
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10

    Angry Error in Formula

    I have 4 fields in a Form:



    Debit
    Credit
    Tax (Yes/No field)

    Total - here is the formula I have:
    =(Round(IIf('Tax'='Y',('Debit'+'Credit')*1.07,('De bit'+'Credit')),2))

    but this is the message I receive:
    #Type!

    is my formula not correct?

  2. #2
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    Quote Originally Posted by TheProfessorIII View Post
    I have 4 fields in a Form:

    Debit
    Credit
    Tax (Yes/No field)

    Total - here is the formula I have:
    =(Round(IIf('Tax'='Y',('Debit'+'Credit')*1.07,('De bit'+'Credit')),2))

    but this is the message I receive:
    #Type!

    is my formula not correct?
    Try using field names with brackets around them, not quotes. e.g. [Debit]+[Credit] , and [Tax]

  3. #3
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10
    that worked great - thank you. one last question. if i want this formula to work, do i enter it in the form, query, or table. my form is linked to a query, that is linked to a table. just not sure where to put the formula.

  4. #4
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    Quote Originally Posted by TheProfessorIII View Post
    that worked great - thank you. one last question. if i want this formula to work, do i enter it in the form, query, or table. my form is linked to a query, that is linked to a table. just not sure where to put the formula.
    Never the table.
    You can use formulas in both queries and forms. Sometimes there are reasons to put them in either place. For example, I find, when using a query for a report, it's better to have the calculations in the query.

    (Kathy, who is a real computer science instructor.)

  5. #5
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10
    ok - will put in the query. getting there. the query runs ok now, but the calcalulation is not automatically being calculated....when i enter a debit amount, nothing happens in the total field....am i missing one small step? thanks again.

  6. #6
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    Quote Originally Posted by TheProfessorIII View Post
    ok - will put in the query. getting there. the query runs ok now, but the calcalulation is not automatically being calculated....when i enter a debit amount, nothing happens in the total field....am i missing one small step? thanks again.
    What's the query for? Is it behind the form, or behind a report?
    If on a form, you may have to refresh the form. I use visual basic code on certain events (DoCmd.requery or DoCmd.refresh) Use your Help to look up and understand these functions.

  7. #7
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10
    Query is behind the Form....this is the last thing I am having problems with...
    this formula works ok, but no when I click the Yes/No Tax checkbox.
    it is adding the credit and debit amounts, but when i click the checkbox it is not adding 7% - this is driving me crazy. any thoughts? thansk again.

    Total: (Round(IIf('Tax'='Y',([Debit]+[Credit])*1.07,([Debit]+[Credit])),2))

  8. #8
    SteveH2508 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Chelsea, London, England
    Posts
    117
    Total: (Round(IIf([Tax]=True,([Debit]+[Credit])*1.07,([Debit]+[Credit])),2))

  9. #9
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10
    Thanks for all the responses. They have been extremely helpful!
    One more question. I have a table, that has a field (Name), that has a Display Control property as a Combo Box - linked to another table.
    So basically, when I click on this field in the table, I get a drop-down of Name values. Now, I created a query linked to this table. I entered [Enter Name] in the criteria for this Name field. When I run the query, I get a pop-up asking for me to enter the name....what I need is for a drop-down to appear here, so I can choose the name. Once I choose the name, I should see all records associated with that name. Any suggestions? Hope thisis clear. thank you.

  10. #10
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10
    Question - I have a query. when I enter this (for example) in the criteria [Enter Name], when I run the query I get prompted with a pop-up to enter the name. How can I change this so that the pop-up can be a drop-down/combo box instead? Thanks!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. SQL Formula to Sum Itself
    By Scorpio11 in forum Access
    Replies: 1
    Last Post: 02-19-2011, 11:22 AM
  2. Formula in Form
    By jlclark4 in forum Forms
    Replies: 1
    Last Post: 02-03-2011, 04:41 AM
  3. Refine my formula, please
    By DianeG in forum Queries
    Replies: 4
    Last Post: 05-19-2010, 09:20 AM
  4. Formula
    By hschrunk in forum Access
    Replies: 3
    Last Post: 05-18-2010, 01:40 PM
  5. Help with formula for Query
    By goldie6175 in forum Queries
    Replies: 1
    Last Post: 02-18-2010, 11:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums