Results 1 to 3 of 3
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Change inputed manually date to first day of month

    Hi,



    my userform looks like below:

    Click image for larger version. 

Name:	Przechwytywanie.PNG 
Views:	5 
Size:	76.0 KB 
ID:	30372

    In the bottom you can see a subform where users can add manually Correction_Date (Data_Korekty).
    Users can choose for example date 2017-07-13 but i want to have only 07-2017 as the result.

    I achevied it by changing format in my table field to "mm-yyyy".

    But true date there is a 2017-07-13 - i want to do change it for 2017-07-01.

    So user chooses 2017-07-13 and the date should be saved as 2017-07-01 but looks like 2017-07.
    Or maybe this process can be done without days ? Only month and year?

    thank you for your help!
    Jacek Antek

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    just because you set the format does not change it to the 1st day. It only shows you mm/yy

    you can have a hidden field txt1Mo , that converts the date they enter.
    then have the hidden field connect to the table.
    txt1Mo.ControlSource
    =year(txtDate) & "/" & month(txtDate) & "/1"

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you ranman256 it is working like a charm !

    Best wishes,
    Jacek

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

Similar Threads

  1. Replies: 1
    Last Post: 10-28-2014, 06:36 AM
  2. Replies: 5
    Last Post: 10-08-2014, 02:23 PM
  3. Replies: 43
    Last Post: 08-06-2014, 08:21 PM
  4. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  5. Replies: 8
    Last Post: 05-16-2012, 10:49 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