bobg7 Posted October 7, 2005 Share Posted October 7, 2005 OK, this is not one of my better subjects so I hope someone can help me with it. I have an Excel sheet to do Payroll but I want to convert it to Access. There is one Excel formula I am having problems getting to work. The Excel formula is: =IF(([gross_pay]-[federal_allowance]*59.62)>592,74.35+(([gross_pay]-[federal_allowance]*59.62)-592)*0.25,13.6+(([gross_pay]-[federal_allowance]*59.62)-187)*0.15) And when I do this: me.[federal_income_tax]=IF(([gross_pay]-[federal_allowance]*59.62)>592,74.35+(([gross_pay]-[federal_allowance]*59.62)-592)*0.25,13.6+(([gross_pay]-[federal_allowance]*59.62)-187)*0.15) I get an 'Expression Error' on the word 'IF' Thanks in advance, Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going. Link to comment Share on other sites More sharing options...
GraphicsGuy Posted October 7, 2005 Share Posted October 7, 2005 First let me qualify this with the statement that I am no expert on this. I did a look up in Access 2003 online help for "If Statement". It appears that access doesn't us the traditional "IF" but rather uses "IIf" which, as I understand it, is taken from VBA. Also, it doesn't indicate supporting that in a query expression. It only mentions using it in calculated controls. For more details, go to the Access help menu and type in "IF Statement". Rule #1: Without exception, backup your database and files before making any changes to your files or database. Rule #2: Make sure there are no exceptions to Rule #1. Link to comment Share on other sites More sharing options...
bobg7 Posted October 7, 2005 Author Share Posted October 7, 2005 That did the trick :thumbsup: I tried the 'Help' in Access but it's not installed and I can't find my cd's to install it. Thanks for your help GraphicsGuy I guess now it's working, I have to start writing payroll checks - ;) Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.