Results 1 to 3 of 3
  1. #1
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102

    Get a specific value from a table as soon as you open the form

    So i have a table that looks like this:

    As you can see there is a row with the name "Jahr" and with the name "Monat".
    Monat = Month
    Jahr = Year



    And I would like that as soon as my form is opened, the output of "Target hourly balance month" is made in a text field.
    That means e.g:
    It is today 7 June 2023
    Then I want the output of the year 2023 in June:
    So the text field must say 198.


    How do I do that?

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    You use a dLookup with today's month and year as the criteria:

    DLookup("Target hourly balance month","YourTable","Jahr=" & Year(Date()) & " AND Monat = " & Month(Date()))

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

  3. #3
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    Thank you very much!

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

Similar Threads

  1. Replies: 3
    Last Post: 01-30-2022, 01:34 AM
  2. Open Form To Specific Tab
    By shoelesscraig in forum Modules
    Replies: 4
    Last Post: 12-22-2015, 01:56 PM
  3. Macro to open table to a specific record
    By Stretholox in forum Access
    Replies: 5
    Last Post: 12-08-2014, 03:09 PM
  4. Replies: 4
    Last Post: 10-05-2011, 01:28 PM
  5. Open to specific form
    By ecpike in forum Forms
    Replies: 2
    Last Post: 06-12-2009, 08:32 AM

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