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?
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]
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.)
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.
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))
Total: (Round(IIf([Tax]=True,([Debit]+[Credit])*1.07,([Debit]+[Credit])),2))
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.
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!