Thursday, August 19, 2010

Microsoft Access help needed!?

Microsoft Access help!?


I have a Microsoft Access project that has a list of various inventory items for a store with the purchase price and the sale price. I'm supposed to calculate the markup% from two different amounts and convert them to percentages; I've done that. In addition to that, the next column is where I'm stuck at. It's supposed to be an "alert" column that displays the wording "HIGH MARKUP" or "LOW MARKUP" which I can't get the right equation for. If the Markup% is 100%26gt;= then I'm supposed to have it flagged as "HIGH MARKUP" whereas if it's 100%26lt; it has to be flagged "LOW MARKUP".





I KNOW it's supposed to be an "IFF" function, but I can't get it right. I have this so far:





Alert: IIF ([markup%] 100%26gt;=, "ATTENTION: HIGH MARKUP", "ATTENTION: LOW MARKUP")





This equation isn't working at all and NOTHING is popping up! Please help! Thank you!

Microsoft Access help needed!?
IIF function is ideal for something like that. But the part that says "[markup%] 100%26gt;=" looks wrong. The "100" appers to be in the wrong spot.





Perhaps you mean this:





IIF([markup%] %26gt;= 100 , "ATTENTION: HIGH MARKUP", "ATTENTION: LOW MARKUP")





This should work.
Reply:I'll be honest with you. Yes the IIF statement should work, however if your doing all that in a query, on any system that is going to have a decent amount of data in it your going to slow it down like lint through goldem syrup.





I would suggest you create a VBA module with the calculations in that way you do away with all that. All you do is parse the 2 amounts to the public function and bring back the text "Attention: High Markup" or "Attention: Low Markup".








By parsing it into a Public Function you get the added advantage of far mor flixibility and ease of maiteneance.





Also if you need to use the same one in another query or form you just call the module.





If you need me to explain contact me.

shoes agents

No comments:

Post a Comment