Results 1 to 12 of 12
  1. #1
    JHJapay is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    6

    How to display Compensation Rate by entering the Salary Grade and Step Level?

    Hi guys! I wanted to automatically display the value in the "SG 2nd Tranch (2021)" table in the Compensation Rate cell by just entering the Salary Grade and the Step number.
    Can anyone please help me? Your help is very much appreciated.
    Thanks!



    Click image for larger version. 

Name:	1.jpg 
Views:	32 
Size:	169.0 KB 
ID:	43727Click image for larger version. 

Name:	2.jpg 
Views:	29 
Size:	151.9 KB 
ID:	43728

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    If you store your data correctly this becomes easy.

    Salary_Grade StepLevel Salary
    1 1 12034
    1 2 12134
    1 3 12236
    1 4 12339
    1 5 12442


    If there is ever another step added you just add it as data and are not having to redesign your table and all the forms.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    I agree with Minty, best to normalize your data, you can probably get the look you have in SG 2nd Tranch (2021) with a crosstab query.

    Until then maybe try a dlookup:
    =DLookup("Step " & [Step],
    "SG 2nd Tranch (2021)","[Salary Grade]=" & [Salary Grade])

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Also, do not use spaces in object names.
    Object names should be letters and/or numbers (exception is the underscore)

  5. #5
    JHJapay is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    6
    Hello Minty, as advised, I followed your table. Would you be so kind to recommend the next thing to do, especially with my compensation rate formula?

    Click image for larger version. 

Name:	1.jpg 
Views:	18 
Size:	115.0 KB 
ID:	43763

  6. #6
    JHJapay is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    6
    Thank you Gicu for the reply. Unfortunately, there was an error when I run your recommendation "=DLookup("Step " & [Step],"SG 2nd Tranch (2021)","[Salary Grade]=" & [Salary Grade])".
    Would you mind advising what to do after following Minty's recommendation where I redesign my table?
    Attached Thumbnails Attached Thumbnails 1.jpg  

  7. #7
    JHJapay is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    6
    Hello ssanfu! Thank you so much for the advise. It is well noted.

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    What was the error. Have you checked if the field names matched?

    Maybe try:
    =DLookup("[Salary]","[SG Table]", "[Salary_Grade]=" & [Salary_Grade] & " AND [StepLevel] =" & [Step])
    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  9. #9
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    And probably better just bring the new table in your query, join it by Salary_Grade and Step and bring in the Salary field.

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  10. #10
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    I'd agree 100% with Vlad, simply add the table to your query and join on the Salary_Grade and Step.
    The Salary field will then be the correct value.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  11. #11
    JHJapay is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    6
    Quote Originally Posted by Gicu View Post
    What was the error. Have you checked if the field names matched?

    Maybe try:
    =DLookup("[Salary]","[SG Table]", "[Salary_Grade]=" & [Salary_Grade] & " AND [StepLevel] =" & [Step])
    Cheers,
    Vlad
    Hi Vlad! This was magical. I can now sleep. Cheers to that!
    So every time I just enter a salary grade and step level, the compensation rate automatically pops up so no need to input it every now and then.

    Click image for larger version. 

Name:	SharedScreenshot.jpg 
Views:	12 
Size:	109.0 KB 
ID:	43772

    Million thanks to you and the rest of the guys here!

  12. #12
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Glad to hear you got it working

    Happy holidays and a happier new year!
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Step by Step viewing Submit Button actions
    By farmer4H in forum Forms
    Replies: 27
    Last Post: 07-23-2019, 05:10 PM
  2. Replies: 3
    Last Post: 07-10-2018, 11:44 PM
  3. Grade level table and subjects table
    By Khalil Handal in forum Access
    Replies: 4
    Last Post: 12-10-2016, 05:20 AM
  4. Replies: 2
    Last Post: 10-21-2016, 11:26 AM
  5. Replies: 1
    Last Post: 10-02-2013, 04:54 PM

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