Results 1 to 7 of 7
  1. #1
    nicolareina is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    6

    how do I display the previous month


    Hello forum I need to display the previous month in the text box do you have any solution? for example if today is 03/01/2023 I want to display December in the textbox.

    Click image for larger version. 

Name:	SCREEN.jpg 
Views:	29 
Size:	58.4 KB 
ID:	49400Click image for larger version. 

Name:	SCREEN2.jpg 
Views:	29 
Size:	80.4 KB 
ID:	49401

    THANKS
    Attached Files Attached Files

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    nicolareina is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    6
    you can insert the code in control source?? no query

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,910
    Quote Originally Posted by nicolareina View Post
    you can insert the code in control source?? no query
    Why not just try it?, takes seconds, and not going to affect anything?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Quote Originally Posted by nicolareina View Post
    you can insert the code in control source?? no query
    both query and control source'

    control source would be
    Code:
    =DateAdd("m",-1,Date())
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    This will display "December"

    =Format(DateAdd("m",-1,Date()),"mmmm")
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  7. #7
    nicolareina is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    6
    thanks i resolve

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

Similar Threads

  1. Sum First, Second, and Third Month of Previous Quarter?
    By aellistechsupport in forum Queries
    Replies: 1
    Last Post: 05-08-2020, 03:44 PM
  2. Previous/Next Month Button
    By archy321 in forum Programming
    Replies: 11
    Last Post: 12-15-2018, 11:43 PM
  3. Replies: 2
    Last Post: 02-12-2015, 05:14 AM
  4. Replies: 2
    Last Post: 04-15-2014, 08:43 AM
  5. Replies: 1
    Last Post: 03-02-2012, 11:09 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