Creating and comparing text fields

Posted on 2011-03-04
Last Modified: 2012-05-11
I have a form called “frmppm” that displays Monthly Accounts, Amounts & Total of the Amounts when you enter the Person ID and Select the Period. This data is all from a table called “ppm”.
My next task is to create another text box next to my Totals that has the Annual pay of this user divided by 12. This data comes from the “Annual Pay” field from another table called “Vendors”. The Fiscal year starts on the 1st of September of a year and ends on August 31st of the following year. Example we are in Fiscal Year 2011 which is indicated by “FY11” in the "FY" field of the vendors table. If the period selected for example is October 2010, then the “Annual Pay” that should be selected from the “Vendors” table is the one that has “FY11” and divide that amount by 12 to display in this new text box. If the period selected for example is October 2009, then the “Annual Pay” that should be selected from the “Vendors” table is the one that has “FY10” and divide that amount by 12 to display in this new text box. These 2 amounts from the text boxes are suppose to be the same but if they are different I want an error message to display Saying  they are not equal. Can you please help me to accomplish this task. Attached is a copy of the database with the ppm table, query and form. Also Attached is a copy of the Vendors table in excel format. I have also hi lighted the fields that matter in the vendors table.

Question by:Chrisjack001
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
  • 3
  • 3
LVL 85
ID: 35039703
You can use the DLookup function to "lookup" your value:

Me.YourTextbox = DLookup("Annual Pay", "Vendors", "FY='FY" & Cstr(Right(Me.txFY,2) - 1)) & "'")

Expert Comment

ID: 35040105
I think that is about it

Expert Comment

ID: 35040142
Sorry hit the wrong button!

I have made the requested changes (and a couple more)

See what you think

Bye the way, before you add too much more to the database, you need to take a serious look at the table structure

It will make your life a lot harder in the future if you dont sort it out now Database11.mdb
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 35040332
This is it but they need to type the Person_nbr in the Person ID field as it was originally. Is it not possible to accomplish both

Accepted Solution

TinTombStone earned 500 total points
ID: 35043039
Changed it back for you Database11.mdb

Author Comment

ID: 35052237
That Part is working again fine but it seems the error message is popping up every time you change the Month year date even when the totals are equal the error message keeps popping up. Thanks for your help again

Author Closing Comment

ID: 35062470
Please disregard my previous email. The form is working perfectly as required. You are awesome. Thanks for all your help.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

631 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